Skip to content

Commit

Permalink
Switch to info log level
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks committed Aug 16, 2024
1 parent 58f435c commit 93aae85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions auth/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (auth *Authenticator) AuthenticateCookie(rq *http.Request, response http.Re
_, err := auth.datastore.Get(auth.DocIDForSession(cookie.Value), &session)
if err != nil {
if base.IsDocNotFoundError(err) {
base.WarnfCtx(auth.LogCtx, "Session not found: %s", base.UD(cookie.Value))
base.InfofCtx(auth.LogCtx, base.KeyAuth, "Session not found: %s", base.UD(cookie.Value))
return nil, base.HTTPErrorf(http.StatusUnauthorized, "Session Invalid")
}
return nil, err
Expand Down Expand Up @@ -73,7 +73,7 @@ func (auth *Authenticator) AuthenticateCookie(rq *http.Request, response http.Re
}

if session.SessionUUID != user.GetSessionUUID() {
base.WarnfCtx(auth.LogCtx, "Session no longer valid for user %s", base.UD(session.Username))
base.InfofCtx(auth.LogCtx, base.KeyAuth, "Session no longer valid for user %s", base.UD(session.Username))
return nil, base.HTTPErrorf(http.StatusUnauthorized, "Session no longer valid for user")
}
return user, err
Expand Down
4 changes: 2 additions & 2 deletions rest/session_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ func (h *handler) getUserFromSessionRequestBody() (auth.User, error) {
}

if user == nil {
base.WarnfCtx(h.ctx(), "Couldn't create session for user %q: not found", base.UD(params.Name))
base.InfofCtx(h.ctx(), base.KeyAuth, "Couldn't create session for user %q: not found", base.UD(params.Name))
return nil, nil
}

authenticated, reason := user.AuthenticateWithReason(params.Password)
if !authenticated {
base.WarnfCtx(h.ctx(), "Couldn't create session for user %q: %s", base.UD(params.Name), reason)
base.InfofCtx(h.ctx(), base.KeyAuth, "Couldn't create session for user %q: %s", base.UD(params.Name), reason)
return nil, nil
}

Expand Down

0 comments on commit 93aae85

Please sign in to comment.