From ee9862acec6ecc55efae35111d0af4630dcda7cb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 Nov 2020 11:24:15 +0100 Subject: [PATCH] Handle email array in ldap --- peertube-plugin-auth-ldap/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/peertube-plugin-auth-ldap/main.js b/peertube-plugin-auth-ldap/main.js index 6854b93..ee93863 100644 --- a/peertube-plugin-auth-ldap/main.js +++ b/peertube-plugin-auth-ldap/main.js @@ -173,6 +173,9 @@ async function login (peertubeHelpers, settingsManager, options) { let username = user[usernameProperty] || '' username = username.replace(/[^a-z0-9._]/g, '_') + let email = user[mailProperty] + if (Array.isArray(email)) email = email[0] + return res({ username, email: user[mailProperty]