Handle email array in ldap

This commit is contained in:
Chocobozzz 2020-11-10 11:24:15 +01:00
parent 9b3754b7ff
commit ee9862acec
No known key found for this signature in database
GPG Key ID: 583A612D890159BE

View File

@ -173,6 +173,9 @@ async function login (peertubeHelpers, settingsManager, options) {
let username = user[usernameProperty] || '' let username = user[usernameProperty] || ''
username = username.replace(/[^a-z0-9._]/g, '_') username = username.replace(/[^a-z0-9._]/g, '_')
let email = user[mailProperty]
if (Array.isArray(email)) email = email[0]
return res({ return res({
username, username,
email: user[mailProperty] email: user[mailProperty]