Update users.js

change method to find existing user
This commit is contained in:
Allemand 2020-06-17 18:07:22 +02:00 committed by GitHub
parent 983714cd72
commit 6d063a4f64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;