Skip to content

Refreshing React SPA browser window, loses existing authenticated state from useAuth(). Can you show example of retaining the state? #10414

Open
@inspiraller

Description

@inspiraller

When loading the react SPA, currently I have to run getAccessTokenSilently() on a poll of a few seconds to constantly check when an accessToken is available again. I also have to do this when refreshing the browser window. I lose all my authenticated state from the useAuth() hook. This is not an ideal solution. Having read about refresh tokens rotation I was wondering if the auth0 handles this internally automatically or whether I need to implement a strategy to retrieve the refresh-token and ultimately authenticated state. Either way, an example would be useful on the quickstart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions