How do you change the reset password URL in meteor?
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}`;
}
);
Late to the party ...
Instead of changing the whole text, you can just change the url with:
Meteor.startup(function() {
Accounts.urls.resetPassword = function(token) {
return Meteor.absoluteUrl('reset-password/' + token);
};
});