fix: log unknown usernames too for failed attempts (#19199)

[skip ci]
This commit is contained in:
Ankush Menat 2022-12-08 17:41:47 +05:30 committed by GitHub
parent 0aa24cc5ef
commit 57c81b2f42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -230,10 +230,11 @@ class LoginManager:
if not (user and pwd):
self.fail(_("Incomplete login details"), user=user)
_raw_user_name = user
user = User.find_by_credentials(user, pwd)
if not user:
self.fail("Invalid login credentials")
self.fail("Invalid login credentials", user=_raw_user_name)
# Current login flow uses cached credentials for authentication while checking OTP.
# Incase of OTP check, tracker for auth needs to be disabled(If not, it can remove tracker history as it is going to succeed anyway)