1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-11-10 08:24:12 +03:00

Refactor authentication logging to include error flag

This commit is contained in:
Adolfo Gómez García
2024-09-16 16:22:42 +02:00
parent c67eee8b73
commit c7666bb4f2
7 changed files with 41 additions and 36 deletions

View File

@@ -381,7 +381,7 @@ class RegexLdap(auths.Authenticator):
usr = self._get_user(username)
if usr is None:
log_login(request, self.db_obj(), username, 'Invalid user')
log_login(request, self.db_obj(), username, 'Invalid user', as_error=True)
return types.auth.FAILED_AUTH
try:
@@ -390,7 +390,7 @@ class RegexLdap(auths.Authenticator):
usr['dn'], credentials
) # Will raise an exception if it can't connect
except Exception:
log_login(request, self.db_obj(), username, 'Invalid password')
log_login(request, self.db_obj(), username, 'Invalid password', as_error=True)
return types.auth.FAILED_AUTH
# store the user mfa attribute if it is set