-
Notifications
You must be signed in to change notification settings - Fork 51
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
Can't login after logout and redirect #27
Comments
I can confirm this problem exists. I added a triggers.enter logger and found, that after sign-in the user is randomly getting redirected to /logout again. If I try for 5-10 times, I am getting redirected to my homeRoutePath. |
I found the cause of the problem: The flow-routing always stores the previous Route so that when ensureSignedIn sends a user back to sign-in, he can then be redirected to the previous page. That totally makes sense. This just doesn't work if there is a route, which causes the user to be logged out. Then the previous route is "logout". But this can easily be fixed: Just name your logout route "logout" and add it to the "knownRoutes" like this:
That causes flow-routing to not remember the previous route. Then everything works as expected. |
Yeah, that will do the trick! Thanks Marc! |
Thanks @mbernath - life saver - should go to the docs! |
@mbernath Thanks!! Chased this for hours while refactoring my app to replace my own accounts system with useraccounts. Your solution saved me from falling back to my own mediocre implementation for user account management. |
AccountsTemplates.knownRoutes.push('logout'); Thanks @mbernath |
I have the following configuration for useraccounts:
And this is my flow route for handling logout:
The problem is that, whenever I log out I get redirected to the sign in view (as expected) but I won't be able to login again: when I enter the right credentials no errors are shown but the form won't dissapear. Any idea?
The text was updated successfully, but these errors were encountered: