Surfaced on #175.
In OIDC mode, getUser() returns null as soon as currentUser.expired is true (apps/ui/src/lib/auth/oidc-auth.ts). RequireAuth then sends the user to /login.
App access tokens live 5 minutes (OIDC_ACCESS_TOKEN_TTL_SECONDS). The axios client is built to refresh on 401 (single-flight), and automaticSilentRenew is off on purpose so that interceptor owns refresh. If getUser() treats expiry as logout, the route guard fires first and the interceptor never runs.
Do this as part of #83 (UI-02), not as a separate merge after it:
- Keep the session when the access token expires; still expose
getAccessToken() so the 401 handler can refresh.
- Only send the user to
/login when refresh fails (onAuthFailure / no refresh token).
- Add a test that an expired access token + valid refresh does not unmount the shell.
Dependencies
Definition of Done
Surfaced on #175.
In OIDC mode,
getUser()returnsnullas soon ascurrentUser.expiredis true (apps/ui/src/lib/auth/oidc-auth.ts).RequireAuththen sends the user to/login.App access tokens live 5 minutes (
OIDC_ACCESS_TOKEN_TTL_SECONDS). The axios client is built to refresh on 401 (single-flight), andautomaticSilentRenewis off on purpose so that interceptor owns refresh. IfgetUser()treats expiry as logout, the route guard fires first and the interceptor never runs.Do this as part of #83 (UI-02), not as a separate merge after it:
getAccessToken()so the 401 handler can refresh./loginwhen refresh fails (onAuthFailure/ no refresh token).Dependencies
Definition of Done