diff --git a/frappe/auth.py b/frappe/auth.py index e4bde99907..d1dc10817c 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -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)