mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
commit
ad87f9ff4e
1 changed files with 2 additions and 2 deletions
|
|
@ -933,7 +933,7 @@ if (Meteor.isServer) {
|
||||||
user.authenticationMethod = 'oauth2';
|
user.authenticationMethod = 'oauth2';
|
||||||
|
|
||||||
// see if any existing user has this email address or username, otherwise create new
|
// see if any existing user has this email address or username, otherwise create new
|
||||||
const existingUser = Meteor.users.findOne({
|
const existingUser = Users.findOne({
|
||||||
$or: [{ 'emails.address': email }, { username: user.username }],
|
$or: [{ 'emails.address': email }, { username: user.username }],
|
||||||
});
|
});
|
||||||
if (!existingUser) return user;
|
if (!existingUser) return user;
|
||||||
|
|
@ -946,7 +946,7 @@ if (Meteor.isServer) {
|
||||||
existingUser.profile = user.profile;
|
existingUser.profile = user.profile;
|
||||||
existingUser.authenticationMethod = user.authenticationMethod;
|
existingUser.authenticationMethod = user.authenticationMethod;
|
||||||
|
|
||||||
Meteor.users.remove({ _id: existingUser._id }); // remove existing record
|
Meteor.users.remove({ _id: user._id });
|
||||||
return existingUser;
|
return existingUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue