feat(ldap) fix login on ldap
This commit is contained in:
parent
a50ba403fc
commit
d475f3f8e2
|
@ -61,7 +61,7 @@ class AuthLDAP(AuthPlugin):
|
|||
def login(self, login_name, password):
|
||||
if not login_name:
|
||||
return False
|
||||
return self.ldap.authenticate(login_name, password, "uid", self.base_dn)
|
||||
return login_name if self.ldap.authenticate(login_name, password, "uid", self.base_dn) else False
|
||||
|
||||
def user_exists(self, userid) -> bool:
|
||||
attr = self.__find(userid, None)
|
||||
|
@ -306,3 +306,5 @@ class AuthLDAP(AuthPlugin):
|
|||
|
||||
except (LDAPPasswordIsMandatoryError, LDAPBindError):
|
||||
raise BadRequest
|
||||
except IndexError as e:
|
||||
logger.error("Roles in LDAP", exc_info=True)
|
||||
|
|
Loading…
Reference in New Issue