GRI-1937: panel sends email, name and password to setup and login #142

Merged
vivy merged 1 commit from fix/GRI-1937-panel-setup-email into dev 2026-11-12 16:21:14 +00:00
Owner

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} on POST /setup and {email, password} on POST /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

  • Setup screen: Email, Name, Password, Confirm. Login screen: Email, Password.
  • SessionUser is the server's UserView (id, email, name).
  • GET /session with no cookie answers code unauthorized; the panel waited for not_authenticated, so a returning visitor got "Could not reach the server" instead of the login screen. Fixed.
  • httpRequest reads a plain-text 4xx (axum's JSON rejection) as the error message instead of failing on response.json().
  • Mock and App.test.tsx follow the server's fields and codes; new httpSessionApi.test.ts pins the real client's wire format, which the mock cannot.
  • plan/server/rest-api.md and plan/tests/mvp-acceptance.md AC-1-01..06 say email, not username.

npm run check green locally (28 tests). No Rust change.

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}` on `POST /setup` and `{email, password}` on `POST /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** - Setup screen: Email, Name, Password, Confirm. Login screen: Email, Password. - `SessionUser` is the server's `UserView` (`id`, `email`, `name`). - `GET /session` with no cookie answers code `unauthorized`; the panel waited for `not_authenticated`, so a returning visitor got "Could not reach the server" instead of the login screen. Fixed. - `httpRequest` reads a plain-text 4xx (axum's JSON rejection) as the error message instead of failing on `response.json()`. - Mock and `App.test.tsx` follow the server's fields and codes; new `httpSessionApi.test.ts` pins the real client's wire format, which the mock cannot. - `plan/server/rest-api.md` and `plan/tests/mvp-acceptance.md` AC-1-01..06 say email, not username. `npm run check` green locally (28 tests). No Rust change.
GRI-1937: the panel sends the server's account fields — email, name and password
Some checks failed
CI / cargo fmt (pull_request) Successful in 12s
CI / the pre-push hook (pull_request) Successful in 13s
CI / cargo deny advisories (pull_request) Failing after 2m3s
CI / cargo deny (pull_request) Successful in 2m5s
CI / cargo clippy (pull_request) Successful in 2m32s
CI / repository boundary (pull_request) Successful in 32s
CI / frontend-web (pull_request) Successful in 1m20s
CI / cargo test (pull_request) Successful in 7m58s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 9s
926cf4f543
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.
vivy merged commit 57b52932f0 into dev 2026-11-12 16:21:14 +00:00
vivy deleted branch fix/GRI-1937-panel-setup-email 2026-11-12 16:21:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!142
No description provided.