# CoopGameChooser Task List ## Auth overhaul — username/password instead of random cookie - [x] Data model: add username + password hash/salt to `Player`, enforce unique username, update `AppDbContext` config and create an EF migration; ensure factory reset seeds stay valid. - [x] Cookie pipeline: refactor `UsePlayerIdentity` into a reader that only trusts existing `player` cookies; add helper to issue/clear the cookie after login/register while keeping HttpOnly/SameSite/Secure semantics. - [x] Auth endpoints: add `/api/auth/register`, `/api/auth/login`, `/api/auth/logout`; registration creates the player, sets the `player` cookie, and stores display name; login validates password and reissues cookie; logout clears cookie. - [x] Endpoint auth guard: replace `GetOrCreatePlayer` with a `GetAuthenticatedPlayer` helper that returns 401 when unauthenticated; update all suggest/vote/state endpoints to depend on an authenticated player without creating one implicitly. - [x] Frontend UX: add login/register screen shown when `/api/me` returns 401; on success hide auth pane, preload name, then refresh phase data; include a logout control to clear local state. - [x] Docs: update `API.md` (and `SPEC.md`) to document new auth flows, required auth for existing endpoints, and cookie token behavior. - [x] Ops/migration notes: generate/apply migration, legacy players auto-assigned `legacy-xxxxxxxx` usernames with blank hashes; expect fresh registration or factory reset; IIS/base-path unaffected.