Trying to use Accounts.setPassword on server side using a method
userProfile = Accounts.findUserByEmail(email);
console.log("supplied email is ....", email);
console.log(" user is ..", userProfile._id);
if (userProfile){
var passwordset = Accounts.setPassword(userProfile._id, '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', {logout: false});
console.log("password set value is ....", passwordset);
if (passwordset){
return true;
}
}
}
At first i passed a plain text password as newPassword , and i got the error that only SHA-256 is allowed , so i am passing a SHA-256 Hash , seems like it tries to set , but then what I see is passwordset is undefined. and password is not being set …
What am i missing here? Any help would be greatly appreciated.
Regards