Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accounts.onCreateUser not fired #12

Open
bright-sea opened this issue Feb 21, 2016 · 1 comment
Open

Accounts.onCreateUser not fired #12

bright-sea opened this issue Feb 21, 2016 · 1 comment

Comments

@bright-sea
Copy link

I add Accounts.onCreateUser hook in server/main.js, but it never be triggered.

I can see that new user added into database but without onCreateUser logic applied, even server console didn't show anything. Here is code I added on main.js

Accounts.onCreateUser(function(options, user) {

  console.log("server on create user triggered");

  if (options.profile)
    user.profile = options.profile;

  // If this is the first user going into the database, make them an admin
  if (Meteor.users.find().count() === 0)
    user.admin = true;

  return user;
});

Anything I am doing wrong or I am missing at here?

@natecox
Copy link

natecox commented Feb 25, 2016

I don't see anything wrong with the call itself. Are you making sure that it's being called in top level code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants