Skip to content

postSubmitRedirect does not get called when in resetPwd state #14

@funkyeah

Description

@funkyeah

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions