mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
- [LDAP: Check if email attribute is an array, that has many email addresses](https://github.com/wekan/wekan/pull/2519).
Thanks to tdemaret and xet7 !
This commit is contained in:
parent
a2587f94da
commit
31e801cc39
1 changed files with 11 additions and 1 deletions
|
@ -530,6 +530,9 @@ Meteor.methods({
|
|||
Meteor.user().setShowCardsCountAt(limit);
|
||||
},
|
||||
setEmail(email, userId) {
|
||||
if (Array.isArray(email)) {
|
||||
email = email.shift();
|
||||
}
|
||||
check(email, String);
|
||||
const existingUser = Users.findOne(
|
||||
{ 'emails.address': email },
|
||||
|
@ -552,6 +555,9 @@ Meteor.methods({
|
|||
},
|
||||
setUsernameAndEmail(username, email, userId) {
|
||||
check(username, String);
|
||||
if (Array.isArray(email)) {
|
||||
email = email.shift();
|
||||
}
|
||||
check(email, String);
|
||||
check(userId, String);
|
||||
Meteor.call('setUsername', username, userId);
|
||||
|
@ -648,7 +654,11 @@ if (Meteor.isServer) {
|
|||
}
|
||||
|
||||
if (user.services.oidc) {
|
||||
const email = user.services.oidc.email.toLowerCase();
|
||||
let email = user.services.oidc.email;
|
||||
if (Array.isArray(email)) {
|
||||
email = email.shift();
|
||||
}
|
||||
email = email.toLowerCase();
|
||||
user.username = user.services.oidc.username;
|
||||
user.emails = [{ address: email, verified: true }];
|
||||
const initials = user.services.oidc.fullname
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue