-
Notifications
You must be signed in to change notification settings - Fork 10
Description
The AccountsTemplates.submitCallback
adds a Meteor.setTimeout function for a few routes.
In that setTimeout AccountsTemplates.postSubmitRedirect(state);
handles re-directing.
It seems that submitting a reset password can cause the routes onBeforeAction to re-run prior to the timeout firing. In the onBeforeAction AccountsTemplates.setState(route);
is called. This setState refers to At.prototype.setState in useraccounts core. That function calls this.clearState intending to refer to At.prototype.clearState but because AccountsTemplate.clearState
is already defined in iron-routing/client.js it overrides the this.clearState that the function meant to call. Calling. AccountsTemplate.clearState
clears the AccountsTemplates.timedOutRedirect handle causing the code in the setTimeout to never run.
Changing onBeforeAction to an onRun is probably all that is really needed but may want to handle the unintentional overriding of the prototype method too.