mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Returning the userId after creating it
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 },
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user