Skip to content

TokenRefreshError: session deleted by another tab #69

@not-my-profile

Description

@not-my-profile

I'm using @atcute/oauth-browser-client in a Vite app. It works great except that there's a small issue with Vite's HMR.

I have a module that's calling getSession(did, { allowStale: true }) on page load (with a did I've stored in the localStorage after a prior login).
I can reload the page and it works. However when I trigger Vite's HMR by changing the code and then reload the page getSession fails with:

 TokenRefreshError: session deleted by another tab
    TokenRefreshError errors.ts:21
    refreshToken sessions.ts:115
    run sessions.ts:63
    getSession sessions.ts:72

In case it matters: my configureOAuth call is in a different module than the getSession and not rerun by the HMR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions