Skip to content

Commit

Permalink
Don't WARN log UserNotExist errors on ExternalUserLogin failure (#16238)
Browse files Browse the repository at this point in the history
Instead log these at debug - with warn logging for other errors.

Fix #16235

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath authored Jun 23, 2021
1 parent b223d36 commit 5f2ef17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/login_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,11 @@ func UserSignIn(username, password string) (*User, error) {
return authUser, nil
}

log.Warn("Failed to login '%s' via '%s': %v", username, source.Name, err)
if IsErrUserNotExist(err) {
log.Debug("Failed to login '%s' via '%s': %v", username, source.Name, err)
} else {
log.Warn("Failed to login '%s' via '%s': %v", username, source.Name, err)
}
}

return nil, ErrUserNotExist{user.ID, user.Name, 0}
Expand Down

0 comments on commit 5f2ef17

Please sign in to comment.