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.
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
getSessionfails with:In case it matters: my
configureOAuthcall is in a different module than thegetSessionand not rerun by the HMR.