Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postSubmitRedirect does not get called when in resetPwd state #14

Open
funkyeah opened this issue Feb 21, 2016 · 3 comments
Open

postSubmitRedirect does not get called when in resetPwd state #14

funkyeah opened this issue Feb 21, 2016 · 3 comments

Comments

@funkyeah
Copy link

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.

@funkyeah funkyeah changed the title postSubmitRedirect does not work properly for resetPwd state postSubmitRedirect does not get called when in resetPwd state Feb 21, 2016
@skarborg
Copy link

skarborg commented Jun 1, 2016

+1

@skarborg
Copy link

skarborg commented Jun 1, 2016

Found a work-around yet? I have live apps that don't redirect after users change their passwords!

@skarborg
Copy link

skarborg commented Jun 14, 2016

This did it for me!!

  onSubmitHook: (error, state) ->
    if (state == "resetPwd")
      Router.go '/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants