Admin: gebruikerslijst blijft actueel, sessie blijft behouden bij tijdelijke refresh-fouten

- Refresh wist de sessie alleen nog bij 400/401/403; 429/5xx/netwerkfout behoudt hem (opstart: rustig opnieuw proberen met backoff, anders gast zonder het cookie te raken)
- Refresh is single-flight (opstart, 401-interceptor, profiel delen een lopende aanvraag)
- GET-verzoeken met cache: no-store; gebruikerslijst: refetch bij focus en poll 45 s; sessie ververst als de eigen rol in de lijst afwijkt

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 13:32:46 +01:00
co-authored by Claude Sonnet 5.5
parent 2cdcb9d868
commit 2f3f7fbb2f
11 changed files with 299 additions and 15 deletions
@@ -12,7 +12,11 @@ export interface AuthContextValue {
isAuthenticated: boolean;
login: (email: string, password: string) => Promise<void>;
logout: () => Promise<void>;
/** Performs a cookie-based silent refresh; resolves to the new token or null. */
/**
* Cookie-based silent refresh, one at a time (callers share the running one). Resolves to the new token, to
* null when the server rejected the session (it is then cleared), and rejects on a transient failure (429, 5xx,
* network) with the session left as it was.
*/
refresh: () => Promise<string | null>;
}