Keep the session when only the access token has expired #219

Merged
jcoffey-dev merged 1 commits from fix/214-refresh-token-guard into main 2026-11-16 15:56:00 +00:00
Owner

The route guard counted an admin as signed in only while the hour-long access token was valid, so any fresh load after that went to the password page even though the refresh token was still good. On a phone, where Android reloads an installed app whenever it comes back, that meant signing in again nearly every time (reported on the forum, t/232).

The guard now also accepts a stored refresh token (hasSession()). The first request renews the access token through apiFetch, and a refused renewal ends the session as before.

Fixes #214

The route guard counted an admin as signed in only while the hour-long access token was valid, so any fresh load after that went to the password page even though the refresh token was still good. On a phone, where Android reloads an installed app whenever it comes back, that meant signing in again nearly every time (reported on the forum, t/232). The guard now also accepts a stored refresh token (`hasSession()`). The first request renews the access token through `apiFetch`, and a refused renewal ends the session as before. Fixes #214
jcoffey-dev added 1 commit 2026-11-16 15:34:04 +00:00
Keep the session when only the access token has expired
ci / build (pull_request) Skipped
ci / notices (pull_request) Successful in 48s
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 4m4s
faa233551d
The route guard counted an admin as signed in only while the hour-long
access token was valid, so any fresh load after that went to the
password page even though the refresh token behind it was still good.
On a phone, where Android reloads an installed app when it comes back,
that meant signing in again nearly every time.

The guard now also accepts a stored refresh token. The first request
renews the access token, and a refused renewal ends the session as
before.

Fixes #214
jcoffey-dev merged commit 10c64a1b2d into main 2026-11-16 15:56:00 +00:00
jcoffey-dev deleted branch fix/214-refresh-token-guard 2026-11-16 15:56:00 +00:00
Sign in to join this conversation.