我正在使用流星的帐户密码包。尝试登录时,它会失败两次,第三次尝试时,它会成功登录。
创建用户的代码
Accounts.createUser({email: email, password : password}, function(err){
if (err) {
console.log('The user creation failed.');
} else {
// Success. Account has been created and the user
// has logged in successfully.
console.log('The user has been created.');
}
});
登录代码
Meteor.loginWithPassword({email:email}, password, function(err){
if (err) {
console.log('login failed');
console.log(err);
} else {
console.log('login success');
}
});
尝试登录时收到“密码错误[403]”错误。
我不明白这是什么问题。请帮我解决这个问题。
由于
答案 0 :(得分:1)
我遇到了完全相同的问题。三分之一的尝试它会起作用。问题是我已经作为用户进行了身份验证。一旦我在控制台中调用Meteor.logout()并登录,它就会在第一次尝试时起作用。