diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-06-17 20:11:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 20:11:20 +0300 |
commit | ad87f9ff4e50e8b042735ad383c5c193e30fc9aa (patch) | |
tree | f2a4585d821334bc2fb78e79bb3e7327e7fa2627 | |
parent | 40abff4c1ea553461def5917d2c0daf79893875e (diff) | |
parent | 768412ba7c2da28f2365e9d0152912aeafb61bbc (diff) | |
download | wekan-ad87f9ff4e50e8b042735ad383c5c193e30fc9aa.tar.gz wekan-ad87f9ff4e50e8b042735ad383c5c193e30fc9aa.tar.bz2 wekan-ad87f9ff4e50e8b042735ad383c5c193e30fc9aa.zip |
Merge pull request #3180 from salleman33/patch-1
Update users.js
-rw-r--r-- | models/users.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/users.js b/models/users.js index 2b5a059e..8675dbad 100644 --- a/models/users.js +++ b/models/users.js @@ -933,7 +933,7 @@ if (Meteor.isServer) { user.authenticationMethod = 'oauth2'; // 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 }], }); if (!existingUser) return user; @@ -946,7 +946,7 @@ if (Meteor.isServer) { existingUser.profile = user.profile; existingUser.authenticationMethod = user.authenticationMethod; - Meteor.users.remove({ _id: existingUser._id }); // remove existing record + Meteor.users.remove({ _id: user._id }); return existingUser; } |