# @auth0/auth0-angular user$

**URL:** <https://community.auth0.com/t/auth0-auth0-angular-user/102847>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [March 18, 2023, 2:16pm UTC](https://community.auth0.com/t/auth0-auth0-angular-user/102847 "2023-03-18T14:16:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![graham.kelly](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@graham.kelly](https://community.auth0.com/u/graham.kelly)\
**Post date:** [March 18, 2023, 2:16pm UTC](https://community.auth0.com/t/auth0-auth0-angular-user/102847/1 "2023-03-18T14:16:47Z")

</div>

Hey,

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:

1. Wait past access tokens expiration period
2. Navigate to a route protected as mentioned above
3. 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)
4. 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?

Thanks!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 20, 2023, 9:07am UTC](https://community.auth0.com/t/auth0-auth0-angular-user/102847/2 "2023-03-20T09:07:12Z")

</div>

Hey there!

It seems like the most effective way to handle that would be to raise a GitHub issue in the angular repo here:

> **[GitHub - auth0/auth0-angular: Auth0 SDK for Angular Single Page Applications](https://github.com/auth0/auth0-angular)**
>
> Auth0 SDK for Angular Single Page Applications. Contribute to auth0/auth0-angular development by creating an account on GitHub.

so we can discuss it directly with the repo maintainers. Once you have a link to it make sure to share it here so we can ping them. Thank you!

---

<div class="post-metadata">

**Author:** ![graham.kelly](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@graham.kelly](https://community.auth0.com/u/graham.kelly)\
**Post date:** [March 20, 2023, 11:05am UTC](https://community.auth0.com/t/auth0-auth0-angular-user/102847/3 "2023-03-20T11:05:57Z")

</div>

Interestingly updating to V2 of the @auth0/auth0-angular fixed this issue and for anyone wondering the migration process is fairly straight forward and is documented here: [auth0-angular/MIGRATION\_GUIDE.md at master · auth0/auth0-angular · GitHub](https://github.com/auth0/auth0-angular/blob/master/MIGRATION_GUIDE.md)

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 20, 2023, 2:10pm UTC](https://community.auth0.com/t/auth0-auth0-angular-user/102847/4 "2023-03-20T14:10:46Z")

</div>

Perfect! Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 3, 2023, 2:11pm UTC](https://community.auth0.com/t/auth0-auth0-angular-user/102847/5 "2023-04-03T14:11:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
