Add username to authenticated log messages

This commit is contained in:
Deluan
2022-12-14 09:35:30 -05:00
parent f206d81afd
commit 982b604500
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -98,7 +98,9 @@ func authenticate(ds model.DataStore) func(next http.Handler) http.Handler {
// }
//}()
ctx = log.NewContext(r.Context(), "username", username)
ctx = request.WithUser(ctx, *usr)
ctx = request.WithUsername(ctx, usr.UserName)
r = r.WithContext(ctx)
next.ServeHTTP(w, r)