0
我的工作与流星自定义登录系统上,我遇到了以下错误使用Accounts.forgotPassword()
功能时:Uncaught Error: Must pass options.email
流星:必须通过options.email未被捕获的错误
这是我对相对HTML端:
<form id="recovery-form" action="action" class="form-horizontal">
<h4>Recover Password</h4>
<label>Email:</label>
<input id ="recoveryEmail" type="text" name="recoveryEmail">
<input id="sendResetInstructionbtn" class="btn btn-default loginbtn" type="submit" value="Send Reset Instructions">
</form>
,这是提交功能:
'submit #recovery-form': function(event, template) {
event.preventDefault();
var validated = true;
email = trimInput(template.find('#recoveryEmail').value);
if(email === "") {
alert("Email is empty");
console.log("Email is empty");
}
if (validated) {
Session.set('loading', true);
Accounts.forgotPassword({email: email}, function(err) {
if (err) {
alert("Password Reset Failed");
console.log("Password Reset Failed" + err);
} else {
alert("Email sent");
console.log("Email sent, check email");
}
Session.set('loading', false);
});
}
return false; // Stops page from reloading
}
它运行得很顺利,直到Accounts.forgotPassword本功能离子
请协助,我有点流星noob。