mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed error occurring while LDAP authentication for a user with multiple email attributes. #5352
This commit is contained in:
@@ -97,7 +97,11 @@ class LDAPAuthentication(BaseAuthentication):
|
||||
return status, msg
|
||||
|
||||
if 'mail' in ldap_user:
|
||||
user_email = ldap_user['mail'].value
|
||||
mail = ldap_user['mail'].value
|
||||
if isinstance(mail, list) and len(mail) > 0:
|
||||
user_email = mail[0]
|
||||
else:
|
||||
user_email = ldap_user['mail'].value
|
||||
|
||||
return self.__auto_create_user(user_email)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user