mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 01:10:12 +01: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);
|
Meteor.user().setShowCardsCountAt(limit);
|
||||||
},
|
},
|
||||||
setEmail(email, userId) {
|
setEmail(email, userId) {
|
||||||
|
if (Array.isArray(email)) {
|
||||||
|
email = email.shift();
|
||||||
|
}
|
||||||
check(email, String);
|
check(email, String);
|
||||||
const existingUser = Users.findOne(
|
const existingUser = Users.findOne(
|
||||||
{ 'emails.address': email },
|
{ 'emails.address': email },
|
||||||
|
|
@ -552,6 +555,9 @@ Meteor.methods({
|
||||||
},
|
},
|
||||||
setUsernameAndEmail(username, email, userId) {
|
setUsernameAndEmail(username, email, userId) {
|
||||||
check(username, String);
|
check(username, String);
|
||||||
|
if (Array.isArray(email)) {
|
||||||
|
email = email.shift();
|
||||||
|
}
|
||||||
check(email, String);
|
check(email, String);
|
||||||
check(userId, String);
|
check(userId, String);
|
||||||
Meteor.call('setUsername', username, userId);
|
Meteor.call('setUsername', username, userId);
|
||||||
|
|
@ -648,7 +654,11 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.services.oidc) {
|
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.username = user.services.oidc.username;
|
||||||
user.emails = [{ address: email, verified: true }];
|
user.emails = [{ address: email, verified: true }];
|
||||||
const initials = user.services.oidc.fullname
|
const initials = user.services.oidc.fullname
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue