Spaces:
Runtime error
Runtime error
Commit History
-
Phase 3a: username login, character ownership, content rating, Alembic
Ships Phase 3a (social/identity foundation) on top of the Phase 2b agent + post-match work. The 2b source files were tracked alongside this commit because they had not been previously committed and the 3a code imports from them. Phase 3a changes ---------------- Data model - Player: new `username` (unique, 3-24 chars, [a-z0-9_], NOT NULL) and `max_content_rating` (family/mature/unrestricted, default family). - Character: new `owner_id` (FK players.id, NULL = system/preset), `visibility` (public/private) and `content_rating`. - Preset ratings applied: Viktor + Kenji = mature; Margot + Archibald = family. Auth + routes - `app/auth.py`: cookie-based require_player / get_optional_player dependencies, NotAuthenticated exception (→ 303 redirect for HTML, → 401 JSON for /api/). Username validation + guest-name generator. - `GET/POST /login` — claim a username. Existing guest_* cookies can rename into a real username (preserves matches + memories). - `GET /logout`, `GET /api/me`,…06fed2f