Reported on the forum (https://community.coffeylabs.org/t/232, post 27): the console installed as an app on an Android phone keeps signing him out, while the laptop stays signed in.
ProtectedRoute (src/components/layout/ProtectedRoute.tsx:18) decides "signed in" with isAuthenticated(), which only checks that the access token hasn't expired (src/stores/authStore.ts:157). The access token lasts an hour; the refresh token 30 days. So any fresh page load more than an hour after the last request goes to /login and on to the password page, even though apiFetch would have refreshed quietly. A laptop tab stays mounted and refreshes on its next request; Android kills background apps, so reopening is a cold load.
Fix: treat a stored refresh token as signed in (isAuthenticated() || !!refreshToken) and let the first request refresh; a refused refresh already ends the session. Add a test for the guard. Optional: refresh on visibilitychange/pageshow when the token is close to expiry.
Separately, he'll also need "Stay signed in on this device" turned on in the phone app; the setting is per browser.
Reported on the forum (https://community.coffeylabs.org/t/232, post 27): the console installed as an app on an Android phone keeps signing him out, while the laptop stays signed in.
`ProtectedRoute` (`src/components/layout/ProtectedRoute.tsx:18`) decides "signed in" with `isAuthenticated()`, which only checks that the access token hasn't expired (`src/stores/authStore.ts:157`). The access token lasts an hour; the refresh token 30 days. So any fresh page load more than an hour after the last request goes to `/login` and on to the password page, even though `apiFetch` would have refreshed quietly. A laptop tab stays mounted and refreshes on its next request; Android kills background apps, so reopening is a cold load.
Fix: treat a stored refresh token as signed in (`isAuthenticated() || !!refreshToken`) and let the first request refresh; a refused refresh already ends the session. Add a test for the guard. Optional: refresh on `visibilitychange`/`pageshow` when the token is close to expiry.
Separately, he'll also need "Stay signed in on this device" turned on in the phone app; the setting is per browser.
Fixed in #219. Reopening the console no longer asks for the password while the refresh token is still good; the first request renews the sign-in. Thanks to khashmeshab for the report on the forum (https://community.coffeylabs.org/t/232). It'll be in the next console RC.
Fixed in #219. Reopening the console no longer asks for the password while the refresh token is still good; the first request renews the sign-in. Thanks to khashmeshab for the report on the forum (https://community.coffeylabs.org/t/232). It'll be in the next console RC.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reported on the forum (https://community.coffeylabs.org/t/232, post 27): the console installed as an app on an Android phone keeps signing him out, while the laptop stays signed in.
ProtectedRoute(src/components/layout/ProtectedRoute.tsx:18) decides "signed in" withisAuthenticated(), which only checks that the access token hasn't expired (src/stores/authStore.ts:157). The access token lasts an hour; the refresh token 30 days. So any fresh page load more than an hour after the last request goes to/loginand on to the password page, even thoughapiFetchwould have refreshed quietly. A laptop tab stays mounted and refreshes on its next request; Android kills background apps, so reopening is a cold load.Fix: treat a stored refresh token as signed in (
isAuthenticated() || !!refreshToken) and let the first request refresh; a refused refresh already ends the session. Add a test for the guard. Optional: refresh onvisibilitychange/pageshowwhen the token is close to expiry.Separately, he'll also need "Stay signed in on this device" turned on in the phone app; the setting is per browser.
Fixed in #219. Reopening the console no longer asks for the password while the refresh token is still good; the first request renews the sign-in. Thanks to khashmeshab for the report on the forum (https://community.coffeylabs.org/t/232). It'll be in the next console RC.