Pārlūkot izejas kodu

fix: use first email address when retrieving multiple from LDAP (#2051)

Signed-off-by: Jonas Jöst <jonas@gpplanet.de>
jonasjoest 5 gadi atpakaļ
vecāks
revīzija
3b055f2ed5

+ 1 - 1
server/modules/authentication/ldap/authentication.js

@@ -38,7 +38,7 @@ module.exports = {
           const user = await WIKI.models.users.processProfile({
           const user = await WIKI.models.users.processProfile({
             profile: {
             profile: {
               id: userId,
               id: userId,
-              email: _.get(profile, conf.mappingEmail, ''),
+              email: String(_.get(profile, conf.mappingEmail, '')).split(',')[0],
               displayName: _.get(profile, conf.mappingDisplayName, '???'),
               displayName: _.get(profile, conf.mappingDisplayName, '???'),
               picture: _.get(profile, conf.mappingPicture, '')
               picture: _.get(profile, conf.mappingPicture, '')
             },
             },