When a user clicks on the lost password reset link, meteor proceeds to
- Open http://app/#/reset-password/token
- Call Accounts.onResetPasswordLink
In my case
Accounts.onResetPasswordLink(function (token, done) {
Accounts.resetPassword(token, "dummy")
done()
})
My problem is that I don’t know what I have to do to show the password prompt before doing Account.resetPassword(). The best I have been able to do is to flag in Session that a password change is needed and use “dummy” as the current password for that change
Accounts.onResetPasswordLink(function (token, done) {
// I want a password prompt here
Accounts.resetPassword(token, "dummy")
Session.set("password_change_needed", true) // <- flag
done()
})
then an autorun monitors the “passwod_change_needed” flag and routes to the password change template in which I change the dummy password for a new one.
Template.password_change_prompt.events({
'click button.sumbit' : () => Accounts.changePassword("dummy", new_password)
})
That’s not save because there is a moment during which the password is set to “dummy”.