How do you change the reset password URL in meteor?

前端 未结 3 698
醉梦人生
醉梦人生 2020-12-29 22:42

I am using meteor along with the accounts-password package. I\'m rolling my own login and password changing/resetting UI and want to know...

How can I custom

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 23:29

    See the section on email templates in the Meteor docs:

    resetPassword: An Object with two fields:

    • resetPassword.subject: A Function that takes a user object and returns a String for the subject line of a reset password email.
    • resetPassword.text: A Function that takes a user object and a url, and returns the body text for a reset password email.

    You can customise which url is passed to the reset password email method:

    Accounts.resetPassword.text = function(user, url) {
      return "Click this link to reset your password: /reset-password/" + myId;
    }
    

提交回复
热议问题