Skip to content

Commit b96540c

Browse files
committed
feat(auth): show a clear 'session expired' overlay on any 401 instead of failing silently
When the session became invalid (server restart, idle timeout, revoked token), authFetch only console.warn'd the 401 and every poll failed silently — the UI kept showing stale data with no hint the user had been logged out. Now any 401 (except /auth/* and /sse) raises a session-expired flag that renders a clear modal overlay (portalled to body so it sits above everything) with a 'Log in' button that runs logout() -> back to the login screen. Idempotent, so a burst of concurrent 401s only shows the prompt once. Reuses existing i18n (sessionExpired + login) — no new keys. Verified live via Playwright: after forcing API calls to 401, the overlay appears on the next poll. Rebuilt web/index.html.
1 parent 1e33f09 commit b96540c

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

0 commit comments

Comments
 (0)