-
Notifications
You must be signed in to change notification settings - Fork 74
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
Push State makes redirect reload complete app on login/logout #55
Comments
The logout() in authService seems to miss a call on resolve(). As soon as I add this, my logout described in the first post works as well. |
@MarcScheib As far as I know, you might want the reload so the browser will ask you to save the password. I do agree that some flexibility here might be nice. I'd propose allowing a |
@RWOverdijk Good point. Strange thing is that with my approach I get asked by the browser to store the password. But the prompt appears after the next navigation, not on the one caused by the login navigation. |
Are you sure it's not doing a hard redirect? If not I'm curious how you nailed that :) Anyway, feel free to open up a PR! 🍻 |
Hi Paul,
I have aurelias push state configured on my router config
config.options.pushState = true;
.This causes the application to reload instead of simply navigating to the defined routes on login/logout.
Instead, when I use e.g.
this.router.navigate('/contents');
, the navigation is working without reloads.In your code I can see you were testing the router navigate. Was it not working?
Another idea would be to decouple setToken() and logout() from redirecting so I can call them directly and do the routing on my own.
Right now, for the login I use the following solution:
loginRedirect: ''
This fixes the reload of my page and still does a redirect.
However, for the logout, this is no completely working right now. I need to check this again, but when I set logoutRedirect to '' (
logoutRedirect: ''
) it seems like the promise is not resloving. I will reply on this later.Perhaps I am doing something wrong? Thank you for your reply.
The text was updated successfully, but these errors were encountered: