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?
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
Anything I am doing wrong or I am missing at here?