meteor - How can I set the password of a user created in a fixture -
i create user in fixture , able sign in user. reason, need somehow set password of user (if try sign in without password, 'user has no password set' validation error).
so far have:
var joeid = meteor.users.insert({ username: 'joe' })
using http://docs.meteor.com/#accounts_createuser can this:
accounts.createuser({ 'username' : 'john doe', 'email' : 'john@doe.com', 'password' : 'abc123' //encrypted automatically }, function(err){ if(typeof err === 'undefined'){ //account created might want send email user using account.sendenrollmentemail() } });
which login user on successful creation.
Comments
Post a Comment