How do you change the reset password URL in meteor?

前端 未结 3 704
醉梦人生
醉梦人生 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:33

    It has changed a little bit:

    You have to use

    Accounts.emailTemplates.resetPassword.text
    

    For the url you can simply replace the hashbang instead of parsing the token from the url. As an example (in coffeescript):

    Meteor.startup(() ->
      Accounts.emailTemplates.resetPassword.text = (user, url) ->
         url = url.replace('#/', '')
         return "Click this link to reset your password: " + url
    )
    

    ES6

    Meteor.startup(() =>
      Accounts.emailTemplates.resetPassword.text = function(user, url) {
         url = url.replace('#/', '');
         return `Click this link to reset your password: ${url}`;
       }
    );
    

提交回复
热议问题