The problem is that the Accounts.onCreateUser was running in the client folder. It cannot operate in the client, only on the server.
Why would Meteor.Accounts return "has no method 'onCreateUser'"?
Pergunta
I'm trying to add an accountActive and accountExpirationDate to a user's profile when it is created. According to everything I've read, I should use Accounts.onCreateUser like so:
// Add accountActive and accountExpirationDate
Accounts.onCreateUser(function(options, user) {
if (options.profile) {
user.profile = options.profile;
user.profile.accountActive = false;
user.profile.accountExpirationDate = null;
}
return user;
});
The two fields are not being added and I'm receiving this error in Console.
Uncaught TypeError: Object #<Object> has no method 'onCreateUser'
What am I doing wrong?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow