Accounts.sendResetPasswordEmail仍未找到用户

时间:2017-01-13 02:06:06

标签: meteor meteor-accounts

我在API中使用Accounts.sendResetPasswordEmail忘记密码,为什么它仍然返回User not found,我记录用户查找使用same _id我发现该用户,但在Accounts.sendResetPasswordEmail仍然找不到

 let checkEmail = Meteor.users.findOne({"emails.0.address": json.email}); 
     if (checkEmail) { 
        let email = json.email; let userId = checkEmail._id; 
        Accounts.sendResetPasswordEmail({userId,email},
        function(err, ress) { 
             if (err) { 
                 return Meteor.call('apiResponse', '400' ,res.error); 
             }else { 
                 return 'success'; 
             } 
         }) 
      }

1 个答案:

答案 0 :(得分:0)

您使用Accounts.sendResetPasswordEmail的错误参数,应该是这样的:

Accounts.sendResetPasswordEmail(userId, email);