我正在使用本指南來實現密碼重置。當用戶點擊生成的鏈接時,它應該在Bootstrap中打開我的「resetPassword」模式。密碼恢復助手不會打開我的流星模式
http://blog.benmcmahen.com/post/41741539120/building-a-customized-accounts-ui-for-meteor
在我的客戶\ main.js我有這樣的代碼:
Template.recoverpopup.helpers({
resetPassword : function(t) {
return Session.get('resetPassword');
Modal.show('reset_password');
}
});
if (Accounts._resetPasswordToken) {
Session.set('resetPassword', Accounts._resetPasswordToken);
}
的resetPassword會話變量通過控制檯返回一個值。我是Meteor的新手,我仍然認真思考,但我認爲這個功能沒有運行。
模板代碼:
<template name="recoverpopup">
{{#if resetPassword}}
<div class="modal fade" id="reset_password" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="loginmodal-container">
<h1>Reset je wachtwoord</h1><br>
<div id="reset_error" class="alert alert-danger hide">
<strong>Error:</strong>
</div>
<form id="resetform">
<input type="password" name="pass" id="newpassword" placeholder="Nieuw wachtwoord">
<input type="submit" name="reset" class="register loginmodal-submit" value="Reset">
</form>
</div>
</div>
</div>
{{else}}
<div class="modal fade" id="recovermodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="loginmodal-container">
<h1>Wachtwoord vergeten</h1><br>
<div id="recover_error" class="alert alert-danger hide">
<strong>Error:</strong>
</div>
<div id="recover_info" class="alert alert-info hide">
<strong>Info:</strong>
</div>
<form id="recoverform">
<input type="email" name="email" placeholder="Email-adres">
<!--<input type="password" name="pass" placeholder="Password">-->
<input type="submit" name="recover" class="login loginmodal-submit" value="Verstuur">
</form>
<div class="login-help">
<a href="#" data-toggle="modal" data-target="#registermodal" onclick="$('#recovermodal').modal('hide');">Registreer</a> - <a href="#" data-toggle="modal" data-target="#loginmodal" onclick="$('#recovermodal').modal('hide');" >Login</a>
</div>
</div>
</div>
</div>
{{/if}}
</template>