Fixed LDAP authentication doesn't support mutliple emails in LDAP accounts.

Thanks to buzztiaan !

Fixes #4452
This commit is contained in:
Lauri Ojansivu 2022-04-05 01:56:40 +03:00
parent a91e274785
commit 3394f54fb4

View file

@ -81,7 +81,12 @@ export function getLdapEmail(ldapUser) {
});
}
return ldapUser.getLDAPValue(emailField);
const ldapMail = ldapUser.getLDAPValue(emailField);
if (typeof ldapMail === 'string') {
return ldapMail;
} else {
return ldapMail[0].toString();
}
}
export function getLdapFullname(ldapUser) {