So I’m attempting to use:
Accounts.onCreateUser(function(user) {
user.sub = {};
return user;
});
To add a custom field to the user object - but the above code seems to intefer with:
Accounts.createUser({
email: email,
password: password,
profile: profile
}, […]
Doing the above means that I capture all of the data as expected, and create the extra field, but no email address is saved. Seems weird but there you go. Profile and password are saved fine, but email is ignored.
If I remove the Accounts.onCreateUser
code then the email is saved just fine.
The docs state clearly that either a username or email is required (for obvious reasons), so I’m not even sure how the accounts system is able to create the user without a username or email address…
So what gives? Is this a bug?