So I have a confusing issue:
I’m building a little platform that when started for the first time ever, creates a ‘root’ account on the server side that an Administrator would then use to login to the client side and do admin functions like change password, create new user, etc.
So on server, I have
Meteor.startup(() => {
if (Meteor.users.find().count() == 0)
{
Accounts.createUser({
email: 'root@root.com',
username: 'root',
password: 'root'
});
console.log("First time starting server! Creating root account! Please login as root and change password!");
}
});
Issue is that after that happens, I try to login on the client side, and simply can’t login with that account, although I can lookup Meteor.users and see that the root account definitely is in the user store. What’s weirder is that if i create a second account through the console on the client side, it automatically logs in with that new account, and then i can logout and login with the ‘root’ account successfully!
Does anyone know why this happens? i feel like theres an extra function the client side account creation must fire to enable client side login that creating users on the server side simply doesnt fire. Or is there something else that I’m not aware of?