Returning the userId after creating it

This commit is contained in:
filipenevola
2021-09-03 15:56:27 -07:00
parent ffa585cb40
commit 8445125523
2 changed files with 4 additions and 4 deletions

View File

@@ -899,7 +899,7 @@ const createUser = options => {
user.services.password = { bcrypt: hashed };
}
Accounts._createUserCheckingDuplicates({ user, email, username, options })
return Accounts._createUserCheckingDuplicates({ user, email, username, options })
};
// method for create user. Requests come from the client.

View File

@@ -71,7 +71,7 @@ const createUser = userObject => {
throw new Meteor.Error(400, 'Need to set a username or email');
}
const user = { services: {} };
Accounts._createUserCheckingDuplicates({
return Accounts._createUserCheckingDuplicates({
user,
username,
email,
@@ -94,8 +94,8 @@ Meteor.methods({
const isNewUser = !user;
if (!user) {
createUser(userObject);
user = Accounts._findUserByQuery(selector, {
const userId = createUser(userObject);
user = Accounts._findUserByQuery(userId, {
fields: { emails: 1 },
});
}