marriott-box-image-video-ta.../frontend
DJP c653fe42a6 Auto-refresh Azure access tokens on 401
The SPA's MSAL access token has a 1h lifetime. When the tab idles
past it, the first request after returns a cached-but-expired token,
the backend (correctly) 401s with "Signature has expired", and the
user has to hard-refresh. acquireTokenSilent doesn't always
pre-empt this because its expiry check can pass on the cached entry
that's then expired by the time the backend validates it.

Make the client recover: getToken now accepts { forceRefresh }, and
the api client retries any 401 once with a forced-refresh token. If
the retry also 401s we propagate (means MSAL itself can't refresh —
genuinely signed out — and the user is routed back to the gate on
the next action).

No backend change: the JWT expiry check is correct. Bypass mode is
unaffected (token is "" either way; the retry is a no-op for it).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 18:20:46 -04:00
..
src Auto-refresh Azure access tokens on 401 2026-05-15 18:20:46 -04:00
index.html Dockerize, add Postgres request log, FastAPI + React SPA 2026-05-11 14:56:58 -04:00
package-lock.json Dockerize, add Postgres request log, FastAPI + React SPA 2026-05-11 14:56:58 -04:00
package.json Dockerize, add Postgres request log, FastAPI + React SPA 2026-05-11 14:56:58 -04:00
tsconfig.json Dockerize, add Postgres request log, FastAPI + React SPA 2026-05-11 14:56:58 -04:00
vite.config.ts Dockerize, add Postgres request log, FastAPI + React SPA 2026-05-11 14:56:58 -04:00