From 3394f54fb47ce2830dd72f67fba4f281246c156f Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 5 Apr 2022 01:56:40 +0300 Subject: [PATCH] Fixed LDAP authentication doesn't support mutliple emails in LDAP accounts. Thanks to buzztiaan ! Fixes #4452 --- packages/wekan-ldap/server/sync.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/wekan-ldap/server/sync.js b/packages/wekan-ldap/server/sync.js index f1b25aea8..efe7e35f3 100644 --- a/packages/wekan-ldap/server/sync.js +++ b/packages/wekan-ldap/server/sync.js @@ -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) {