Which SDK this is regarding: auth0-angular
SDK Version: 1.11.1
Platform Version: Angular 15.2.3
Code Snippets/Error Messages/Supporting Details/Screenshots:
I have been struggling to understand an issue i have been having and i’m hoping someone here can help me.
So i have my routes protected by the auth guard provided by @auth0/auth0-angular and a custom auth guard which subscribes to the user$ subscription to get the users roles so i can verify if they have the correct role to access a route. These guards run sequentially.
Steps to repeat issue:
- Wait past access tokens expiration period
- Navigate to a route protected as mentioned above
- AuthGuard does not redirect to Auth0 Login (i assume the isAuthenticated$ is still true because you are authenticated with Auth0, it doesn’t care about whether your access token has expired or not)
- The user$ returns null which according to the docs happens if the user is unauthenticated.
In my head if i got through the first auth guard the second would always be able to retrieve user information.
What am i missing?