AuthN: cleanup logs (#63652)

* AuthN: clean up logs
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Karl Persson
2023-02-24 11:26:55 +01:00
committed by GitHub
co-authored by Ieva
parent 9cae3f43ed
commit 2a7fc3983b
11 changed files with 57 additions and 69 deletions
+5 -4
View File
@@ -54,14 +54,15 @@ func (s *Session) Authenticate(ctx context.Context, r *authn.Request) (*authn.Id
token, err := s.sessionService.LookupToken(ctx, rawSessionToken)
if err != nil {
s.log.Warn("failed to look up session from cookie", "error", err)
s.log.FromContext(ctx).Warn("Failed to look up session from cookie", "error", err)
return nil, err
}
signedInUser, err := s.userService.GetSignedInUserWithCacheCtx(ctx,
&user.GetSignedInUserQuery{UserID: token.UserId, OrgID: r.OrgID})
signedInUser, err := s.userService.GetSignedInUserWithCacheCtx(
ctx, &user.GetSignedInUserQuery{UserID: token.UserId, OrgID: r.OrgID},
)
if err != nil {
s.log.Error("failed to get user with id", "userId", token.UserId, "error", err)
s.log.FromContext(ctx).Error("Failed to get user with id", "userId", token.UserId, "error", err)
return nil, err
}