mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-05-05 12:32:28 +00:00
perf: update authenticated
This commit is contained in:
@@ -92,7 +92,11 @@ class LDAPBaseBackend(LDAPBackend):
|
||||
if not match:
|
||||
logger.info('Authenticate failed: {}'.format(msg))
|
||||
return None
|
||||
ldap_user = LDAPUser(self, username=username.strip(), request=request)
|
||||
try:
|
||||
ldap_user = LDAPUser(self, username=username.strip(), request=request)
|
||||
except Exception as e:
|
||||
logger.error('Authenticate failed: {}'.format(e))
|
||||
return None
|
||||
user = self.authenticate_ldap_user(ldap_user, password)
|
||||
logger.info('Authenticate user: {}'.format(user))
|
||||
return user if self.user_can_authenticate(user) else None
|
||||
|
||||
@@ -170,6 +170,9 @@ def authenticate(request=None, **credentials):
|
||||
and the current user is not in the user list. Please contact the administrator.'''
|
||||
)
|
||||
continue
|
||||
except Exception as e:
|
||||
logger.error('Authenticate failed: {}'.format(e))
|
||||
continue
|
||||
|
||||
if user is None:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user