浏览代码

Merge pull request #3180 from salleman33/patch-1

Update users.js
Lauri Ojansivu 5 年之前
父节点
当前提交
ad87f9ff4e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      models/users.js

+ 2 - 2
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;
     }