Meteor: How to create user without logging him in?

472 views Asked by At

I want to create users by hand in my admin site. I find Accounts.createUser seems to be the solution.

However, Accounts.createUser also logs in the newly created user, which is not what I want. I just want to create a user, not log in.

Is there any way to just create a user in Meteor?

1

There are 1 answers

0
Salketer On

From the doc:

On the client, this function logs in as the newly created user on successful completion. On the server, it returns the newly created user id.

This means that you could simply wrap your user creation into a method and run it only server side. That way you will keep your current logged-in user.