Can't login if user has more than one address email
Hi,
My ldap users have sometime multiple "mail" fields in their ldap definition.
This result an error:
juil. 21 16:48:02 peertube peertube[17733]: "name": "SequelizeValidationError",
juil. 21 16:48:02 peertube peertube[17733]: "errors": [
juil. 21 16:48:02 peertube peertube[17733]: {
juil. 21 16:48:02 peertube peertube[17733]: "message": "email cannot be an array or an object",
juil. 21 16:48:02 peertube peertube[17733]: "type": "string violation",
juil. 21 16:48:02 peertube peertube[17733]: "path": "email",
juil. 21 16:48:02 peertube peertube[17733]: "value": [
juil. 21 16:48:02 peertube peertube[17733]: "user@xxxxxx",
juil. 21 16:48:02 peertube peertube[17733]: "user@yyyyyyy"
juil. 21 16:48:02 peertube peertube[17733]: ],
I have to add this to make it works (it blindly chooses the first email found):
//we want only one email address
if (Array.isArray(user[mailProperty])) {
user[mailProperty] = user[mailProperty][0]
}
I could add a filter to search a specific domain.