Files
Stend_mont/app
ruslan 008b99a85f Redirect to login instead of raw 401 JSON on expired session
A page tab left open past COOKIE_MAX_AGE and then reloaded hit
require_user/require_admin raising before the route body ever ran,
so there was nowhere to catch it and show something friendlier - the
browser just rendered {"detail": "Unauthorized"}. A global exception
handler now redirects GET page loads (never /api/* calls, whose JS
callers parse and handle the JSON error themselves, and never
POST/PUT/DELETE, so a failed login or CSRF check still reports its
own error instead of silently bouncing) with a 401/403 back to /.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-02 11:14:46 +00:00
..