忘记密码无法使用帐户输入(流星)

时间:2014-01-16 08:55:57

标签: coffeescript meteor iron-router

我正在尝试使用Meteor应用中的帐户条目包,但忘记密码无效。我不知道忘记密码是否仅适用于生产或是否也适用于开发。这里是我的模板和账户条目的coffeescript代码:

<template name='entryForgotPassword'>
    <div class="small-12 columns accounts-page">
        <h2 class="page-titles">Forgot your Password?</h2>
        {{#if error}}
            <div class='alert'>{{error}}</div>
        {{/if}}
        <form id='forgotPassword'>
            <input type="email" name="forgottenEmail" placeholder="Email address" value=''>
            <button type="submit" class="button">Email Reset Link</button>
        </form>
   </div>
 </template>



Template.entryForgotPassword.helpers
   error: -> Session.get('entryError')

   logo: ->
      Meteor.call('entryLogo')

Template.entryForgotPassword.events
      'submit #forgotPassword': (event) ->
            event.preventDefault()
            Session.set('email', $('input[type="email"]').val())

      if Session.get('email').length is 0
         Session.set('entryError', 'Email is required')
         return

           Accounts.forgotPassword({
               email: Session.get('email')
           }, (error)->
       if error
           Session.set('entryError', error.reason)
       else
           Router.go AccountsEntry.settings.homeRoute
   )

我点击提交按钮,但我没有收到电子邮件。

服务器控制台打印出:

I20140116-19:51:51.224(0)? ====== BEGIN MAIL #0 ======
I20140116-19:51:51.844(0)? MIME-Version: 1.0
I20140116-19:51:51.844(0)? From: "Meteor Accounts" <no-reply@meteor.com>
I20140116-19:51:51.844(0)? To: hidden@hidden.com
I20140116-19:51:51.845(0)? Subject: How to reset your password on localhost:3000
I20140116-19:51:51.845(0)? Content-Type: text/plain; charset=utf-8
I20140116-19:51:51.845(0)? Content-Transfer-Encoding: quoted-printable
I20140116-19:51:51.846(0)? Hello,
I20140116-19:51:51.846(0)? To reset your password, simply click the link below.
I20140116-19:51:51.846(0)? http://localhost:3000/reset-password/vJTAFEfdnqMsRSRyf
I20140116-19:51:51.846(0)? Thanks.
I20140116-19:51:51.847(0)? ====== END MAIL #0 ======

提前致谢!

1 个答案:

答案 0 :(得分:2)