mirror of
https://github.com/ZTatman/myst.git
synced 2026-11-20 20:07:59 +00:00
Exception handlers run outside FastAPI's dependency injection, so the error handler never resolved the session and always passed user=None, making every error page (e.g. a 404 hit while signed in) show the 'Sign In with Forgejo' header instead of the account menu. Resolve the session by hand from the request cookie via lookup_session, degrading to None on any failure so error rendering can never itself raise. A missing or invalid cookie (a real 401) still yields None and the correct signed-out header. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| auth | ||
| models | ||
| routers | ||
| services | ||
| static | ||
| templates | ||
| __init__.py | ||
| config.py | ||
| database.py | ||
| deps.py | ||
| errors.py | ||
| main.py | ||
| middleware.py | ||
| templating.py | ||