You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug
If the access token get's refreshed by the Nhost client, a hydration mismatch happens (if the access token is displayed) and further requests like page reloads fail, leading to log-out.
To Reproduce
Start the playground, login and wait until the token get's refreshed. Then reload or change the page to see the auth fail.
A possible solution
Adding the following code prevents the bug, but also adds an unecassary, second POST to /api/_nhost/session on each page reload.
plugins/nhost.client.ts: adding onTokenChanged in mounted hook
The bug
If the access token get's refreshed by the Nhost client, a hydration mismatch happens (if the access token is displayed) and further requests like page reloads fail, leading to log-out.
To Reproduce
Start the playground, login and wait until the token get's refreshed. Then reload or change the page to see the auth fail.
A possible solution
Adding the following code prevents the bug, but also adds an unecassary, second POST to
/api/_nhost/session
on each page reload.plugins/nhost.client.ts: adding onTokenChanged in mounted hook
server/api/_nhost/session.ts: adding TOKEN_CHANGED handler
Right now, I can't think of a clean way to prevent the duplicated POST to
/api/_nhost/session
.The text was updated successfully, but these errors were encountered: