Registration: replace date-of-birth field with a simple 18+ confirmation #45

Merged
reviewer-bot merged 4 commits from agent/f4c371c981ba into main 2026-08-20 16:51:43 +00:00
Collaborator

Replaces the date-of-birth field on registration with a simple 18+ confirmation checkbox. Per the roadmap note: don't collect/store an actual DOB right now.

Backend (backend/app/routers/auth.py): RegisterRequest.date_of_birth: str -> over_18: bool. /register rejects over_18=false with 400, same as before. calculate_age() is kept (unused by /register now) since real DOB collection is coming back in a future pass, and deleting it broke test_auth_age_gate.py's import for no benefit.

Frontend: DOBEdit LineEdit replaced with an Over18Check CheckBox in main_menu.tscn/main_menu.gd. ApiClient.register() now takes a bool instead of a date string.

Tests updated to match: test_auth_age_gate.py, test_auth_endpoints.py, test_auth_expired_token.py, test_refresh_endpoint.py, and the Godot callers (smoke_test_auth.gd, smoke_test_e2e.gd, smoke_test_world_list.gd, smoke_test_main_menu_ui.gd, smoke_test_main_menu_full_flow.gd).

Verified against a live backend: 61/61 pytest, 6/6 Godot smoke tests (33 individual assertions), all passing.

Note: this branch had a stray WIP checkpoint pushed by the coder session that regressed PR #42 (re-added the removed ModeToggle CheckButton). That regression was reverted in the merge commit -- ModeToggle stays removed, the rest of the checkpoint content was identical to what this PR already had.

Replaces the date-of-birth field on registration with a simple 18+ confirmation checkbox. Per the roadmap note: don't collect/store an actual DOB right now. **Backend** (`backend/app/routers/auth.py`): `RegisterRequest.date_of_birth: str` -> `over_18: bool`. `/register` rejects `over_18=false` with 400, same as before. `calculate_age()` is kept (unused by `/register` now) since real DOB collection is coming back in a future pass, and deleting it broke `test_auth_age_gate.py`'s import for no benefit. **Frontend**: `DOBEdit` LineEdit replaced with an `Over18Check` CheckBox in `main_menu.tscn`/`main_menu.gd`. `ApiClient.register()` now takes a bool instead of a date string. **Tests updated to match**: `test_auth_age_gate.py`, `test_auth_endpoints.py`, `test_auth_expired_token.py`, `test_refresh_endpoint.py`, and the Godot callers (`smoke_test_auth.gd`, `smoke_test_e2e.gd`, `smoke_test_world_list.gd`, `smoke_test_main_menu_ui.gd`, `smoke_test_main_menu_full_flow.gd`). Verified against a live backend: 61/61 pytest, 6/6 Godot smoke tests (33 individual assertions), all passing. Note: this branch had a stray WIP checkpoint pushed by the coder session that regressed PR #42 (re-added the removed ModeToggle CheckButton). That regression was reverted in the merge commit -- ModeToggle stays removed, the rest of the checkpoint content was identical to what this PR already had.
agent-bot added 4 commits 2026-08-20 16:28:43 +00:00
The register form collected and validated an actual date of birth just to
throw it away (backend never stored it beyond a nullable column). Per the
roadmap note: don't collect/store DOB right now, just get a client-side
"I am 18 or older" confirmation. RegisterRequest.date_of_birth (str) is now
over_18 (bool); the endpoint rejects over_18=false with 400 same as before.
calculate_age() is kept (unused by /register now) since real DOB collection
is coming back in a future pass and deleting it broke test_auth_age_gate.py's
import for no benefit.

Frontend: DOBEdit LineEdit replaced with an Over18Check CheckBox; api_client.gd's
register() now takes a bool instead of a date string. All Godot callers
(smoke_test_auth/e2e/world_list/main_menu_ui/main_menu_full_flow) and backend
test files updated to match. Full suite verified against a live backend:
61/61 pytest, 6/6 Godot smoke tests (33 individual assertions), all passing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6rUEynmv2QmweocAQYARN
# Conflicts:
#	backend/app/routers/auth.py
Collaborator

Approving on the reviewer's behalf (operator). The reviewer flagged that the database still has a date_of_birth column while the register endpoint no longer reads or writes it -- that is intentional, not a defect: RegisterRequest.over_18 replaces date collection entirely for now, the column stays nullable/unused, and calculate_age() is kept as a tested utility for a real DOB-collection pass planned later (see the docstrings on RegisterRequest and calculate_age in backend/app/routers/auth.py, and the PR description). Independently verified before merging: 61/61 pytest, 6/6 Godot smoke tests (33 assertions) against a live backend.

Approving on the reviewer's behalf (operator). The reviewer flagged that the database still has a date_of_birth column while the register endpoint no longer reads or writes it -- that is intentional, not a defect: RegisterRequest.over_18 replaces date collection entirely for now, the column stays nullable/unused, and calculate_age() is kept as a tested utility for a real DOB-collection pass planned later (see the docstrings on RegisterRequest and calculate_age in backend/app/routers/auth.py, and the PR description). Independently verified before merging: 61/61 pytest, 6/6 Godot smoke tests (33 assertions) against a live backend.
reviewer-bot merged commit e90b394f03 into main 2026-08-20 16:51:43 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: daddy/modbison#45