summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-06-17 20:11:20 +0300
committerGitHub <noreply@github.com>2020-06-17 20:11:20 +0300
commitad87f9ff4e50e8b042735ad383c5c193e30fc9aa (patch)
treef2a4585d821334bc2fb78e79bb3e7327e7fa2627 /models
parent40abff4c1ea553461def5917d2c0daf79893875e (diff)
parent768412ba7c2da28f2365e9d0152912aeafb61bbc (diff)
downloadwekan-ad87f9ff4e50e8b042735ad383c5c193e30fc9aa.tar.gz
wekan-ad87f9ff4e50e8b042735ad383c5c193e30fc9aa.tar.bz2
wekan-ad87f9ff4e50e8b042735ad383c5c193e30fc9aa.zip
Merge pull request #3180 from salleman33/patch-1
Update users.js
Diffstat (limited to 'models')
-rw-r--r--models/users.js4
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;
}