API call keeping user logged in

  • Which SDK this is regarding:
  • SDK Version: Angular Auth0 v1.10.0
  • Platform Version: Angular v13.3.11


I am currently trying to call an API on logout of my application but it seems to be causing logout issues and I think this is due to my tenant having refresh tokens enabled.

On the user clicking the logout button:

  1. The application calls an API without awaiting a response.
  2. Then the application calls the Angular Auth0 SDK logout function.

I think since the app is not awaiting the API’s response, the actual API call finishes after the Auth0 logout function is called. This causes a new token to be created by using the refresh token paired with the API call after logout and then keeps the user logged in.

I could wait for the API’s response but I imagine there’s a scenario where users exit the session/browser/tab before the API call is complete which leads the user into believing they’ve logged out since they clicked the logout button but they are still logged in.

Is there any way to make this specific API call so that a new token isn’t created and logout can function as expected? Is it just not possible to call an API right before logging out without awaiting the API’s response?