-
Notifications
You must be signed in to change notification settings - Fork 187
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
Guarding routes with currentUserData Not working after Refresh or Force link. #501
Comments
@TimSwerts did you find a solution to this? I'm experiencing the same. Even if I call validateToken, the currentUserData is still undefined... |
I think I had a similar problem. I did two things, not sure which solved it.
The important thing in the code below is
Full code:
|
I'm submitting a...
Current behavior
I want to reopen an issue. I have kind of the same problem as in the issue #253. I tried to reload the .currentUserData twice and it's not working for me. I think it has something to do with the way I am confronted with this problem.
I am making a AuthGuard or let's say I made it and it works all the time when I am logged in an when I am browsing trough my application. Now I was testing the basic security of my application and I found out that when I use the .currentUserData in my logic of canActivate in my guard and then type in a guarded link, the .currentUserData will be empty so my guard isn't functioning.
I've tried to validate the Token but that doesn't work iether. I think the problem is when I force the browser to go to a certain page the authGaurd works before the component gets loaded in that way the .currentUserData will not be available.
If there is any solution for this problem or if you have extra questions, feel free to respond.
Expected behavior
Getting the currentUserData before the logic of the authGaurd works.
Environment
Angular-Token version: X.Y.Z
Angular version: X.Y.Z
Bundler
Browser:
Others:
Guard:
Router with guard implementation:
The text was updated successfully, but these errors were encountered: