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?
The problem is that the Accounts.onCreateUser was running in the client folder. It cannot operate in the client, only on the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With