# Unable to fully logout when using refresh tokens

**URL:** <https://community.auth0.com/t/unable-to-fully-logout-when-using-refresh-tokens/87286>\
**Category:** Get Help\
**Created:** [July 20, 2022, 4:47pm UTC](https://community.auth0.com/t/unable-to-fully-logout-when-using-refresh-tokens/87286 "2022-07-20T16:47:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![finnbai](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/finnbai/32/38872_2.png) [@finnbai](https://community.auth0.com/u/finnbai)\
**Post date:** [July 20, 2022, 4:47pm UTC](https://community.auth0.com/t/unable-to-fully-logout-when-using-refresh-tokens/87286/1 "2022-07-20T16:47:24Z")

</div>

I’m currently using the Angular Auth0 SDK and I was previously able to logout using the logout({ redirectTo: url }) function but to be able to update the user’s email address without logging them out I turned on refresh tokens and set the cache location to localStorage. Since then I’m unable to fully logout of the application.

Here’s what happens:

1. User clicks logout, logout function is called and is successful
2. User is redirected to our logout page. This logout page is within our single page application.
3. When I manually navigate to our page’s homepage the user is still logged in

In our tenant logs I can see the a “Success Logout” followed by a “Success Silent Auth” and then a “Success Exchange.” I think this may be due to the refresh token still being active so when the user gets to our logout page the Angular app immediately logs them back in using the refresh token.

I’ve tried manually deleting the token in localStorage and the session cookies but nothing seems to help. Is there a tenant configuration I might be missing or a way to revoke the refresh token from the Angular SDK?

Thanks,  
Jordan

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 21, 2022, 4:08am UTC](https://community.auth0.com/t/unable-to-fully-logout-when-using-refresh-tokens/87286/4 "2022-07-21T04:08:56Z")

</div>

Hello @finnbai welcome to the community!

> [@finnbai](#):
>
> I’ve tried manually deleting the token in localStorage and the session cookies but nothing seems to help. Is there a tenant configuration I might be missing or a way to revoke the refresh token from the Angular SDK?

While there isn’t anything specific to the SDK, you can indeed [revoke refresh tokens](https://auth0.com/docs/secure/tokens/refresh-tokens/revoke-refresh-tokens#use-the-authentication-api) using the Authentication API.

> [@finnbai](#):
>
> In our tenant logs I can see the a “Success Logout” followed by a “Success Silent Auth” and then a “Success Exchange.” I think this may be due to the refresh token still being active so when the user gets to our logout page the Angular app immediately logs them back in using the refresh token.

If you’re able to inspect the `/authorize` call made when this occurs and see that the `response_mode = query` then this is indeed due to the refresh token - If `response_mode=web_message` then it is [silent authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication) via a hidden iframe.

Regardless, I definitely recommend sharing your thoughts and voting for the following feedback request if you’re up to it:

> [@Revoke Refresh Token on Logout](https://community.auth0.com/t/revoke-refresh-token-on-logout/80698):
>
> Feature: Remove refresh token from Active devices on logout Description: When a user logs out of a SPA, calling the logout endpoint does not revoke the refresh token. This leaves it available for use if it is compromised on the client-side or in transit. The revoke refresh token endpoint can be called, separately, but it would be good to remove the refresh token for the device on logout. Use-case: We’re building a SaaS AI SPA and use Auth0 to protect access to our resource APIs.

Hope this helps to clarify 😄

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 5, 2022, 4:09am UTC](https://community.auth0.com/t/unable-to-fully-logout-when-using-refresh-tokens/87286/5 "2022-08-05T04:09:37Z")

</div>

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