chore: add user email to log_comment (#6461)

This commit is contained in:
Srikanth Chekuri 2024-11-17 00:36:10 +05:30 committed by GitHub
parent cd1ec561b1
commit 493ae4fd07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -384,6 +384,11 @@ func LogCommentEnricher(next http.Handler) http.Handler {
client = "api" client = "api"
} }
email, err := auth.GetEmailFromJwt(r.Context())
if err != nil {
zap.S().Errorf("error while getting email from jwt: %v", err)
}
kvs := map[string]string{ kvs := map[string]string{
"path": path, "path": path,
"dashboardID": dashboardID, "dashboardID": dashboardID,
@ -392,6 +397,7 @@ func LogCommentEnricher(next http.Handler) http.Handler {
"client": client, "client": client,
"viewName": viewName, "viewName": viewName,
"servicesTab": tab, "servicesTab": tab,
"email": email,
} }
r = r.WithContext(context.WithValue(r.Context(), common.LogCommentKey, kvs)) r = r.WithContext(context.WithValue(r.Context(), common.LogCommentKey, kvs))