Skip to content

Commit

Permalink
Don't WARN log UserNotExist errors on ExternalUserLogin failure (go-g…
Browse files Browse the repository at this point in the history
…itea#16238)

Instead log these at debug - with warn logging for other errors.

Fix go-gitea#16235

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored and AbdulrhmnGhanem committed Aug 10, 2021
1 parent d893689 commit 335a34a
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 335a34a

Please sign in to comment.