GRI-1937: panel sends email, name and password to setup and login #142
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!142
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-1937-panel-setup-email"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Board: GRI-1937. Reported by the product owner on a fresh native install: creating the first account answered
422 — missing field 'email'.Cause. The setup and login screens were written against the mock and send
{username, password}. The server takes{email, name, password}onPOST /setupand{email, password}onPOST /session, and returns{id, email, name}. Already reported on forge #113 as waiting on a decision; this takes the server's contract, because the server already has the column, the validation and the login throttle keyed on email — no migration.Changes
SessionUseris the server'sUserView(id,email,name).GET /sessionwith no cookie answers codeunauthorized; the panel waited fornot_authenticated, so a returning visitor got "Could not reach the server" instead of the login screen. Fixed.httpRequestreads a plain-text 4xx (axum's JSON rejection) as the error message instead of failing onresponse.json().App.test.tsxfollow the server's fields and codes; newhttpSessionApi.test.tspins the real client's wire format, which the mock cannot.plan/server/rest-api.mdandplan/tests/mvp-acceptance.mdAC-1-01..06 say email, not username.npm run checkgreen locally (28 tests). No Rust change.The setup and login screens were written against the mock and sent {username, password}; the server takes {email, name, password} for setup and {email, password} for login, so a fresh install answered 422 to the first account. The panel now uses the server's fields and UserView shape. Two faults the same drift hid: GET /session with no cookie answers code 'unauthorized', and the panel only recognised 'not_authenticated', so a returning visitor saw 'Could not reach the server' instead of the login screen; and a plain-text framework rejection (a 4xx from axum's Json extractor) broke the panel's JSON parse instead of showing the reason. A test now pins the real client's wire format, which the mock cannot.