From 3b055f2ed510712f841d90026f0eb683ed09273f Mon Sep 17 00:00:00 2001 From: jonasjoest <41778330+jonasjoest@users.noreply.github.com> Date: Tue, 16 Jun 2020 06:11:38 +0200 Subject: [PATCH] fix: use first email address when retrieving multiple from LDAP (#2051) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Jöst --- server/modules/authentication/ldap/authentication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/authentication/ldap/authentication.js b/server/modules/authentication/ldap/authentication.js index 5c57bec6..173a02f7 100644 --- a/server/modules/authentication/ldap/authentication.js +++ b/server/modules/authentication/ldap/authentication.js @@ -38,7 +38,7 @@ module.exports = { const user = await WIKI.models.users.processProfile({ profile: { id: userId, - email: _.get(profile, conf.mappingEmail, ''), + email: String(_.get(profile, conf.mappingEmail, '')).split(',')[0], displayName: _.get(profile, conf.mappingDisplayName, '???'), picture: _.get(profile, conf.mappingPicture, '') },