From 133308adf856b8fb482b2b4af796220f1631ef41 Mon Sep 17 00:00:00 2001 From: Jonny Date: Mon, 6 Jul 2026 12:01:44 +0200 Subject: [PATCH] docs: fix curl login verification technique in plan The plain form-urlencoded curl POST in the manual verification steps does not work against a real Next.js Server Action (found during Task 3's manual verification). Documents the correct multipart/$ACTION_ID technique and the test admin credentials in Global Constraints so later tasks don't rediscover this. --- docs/superpowers/plans/2026-07-06-design-system.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/superpowers/plans/2026-07-06-design-system.md b/docs/superpowers/plans/2026-07-06-design-system.md index b35558a..077215e 100644 --- a/docs/superpowers/plans/2026-07-06-design-system.md +++ b/docs/superpowers/plans/2026-07-06-design-system.md @@ -19,6 +19,20 @@ - No changes to Server Actions, RLS policies, the data model, or any redirect/validation logic in `actions.ts` files — visual/structural changes only. - No dark mode (spec explicitly excludes it). - No new automated test dependencies (no `@testing-library/react`, no new test runner config). Verification per task is `npm run build` + `npm test` (existing Vitest suite must stay green) plus a manual/curl-based structural check. Full cross-browser/cross-breakpoint visual verification is done by the project owner in the running Docker container after all tasks land (per spec section 6) — do not attempt to spin up a headless browser for this. +- **Corrected curl login technique** (the plain `curl -d "email=..." -d "password=..." -X POST .../login` shown in some task verification steps below does NOT work against a real Next.js Server Action and will be silently rejected — this was discovered and fixed during Task 3). `login` in `web/app/login/actions.ts` is an *unbound* Server Action; a real `
` submit encodes it as a hidden `multipart/form-data` field named `$ACTION_ID_` (the hash changes on every dev-server restart/rebuild — always re-read it fresh, never hardcode a previously seen value). Correct technique: + ```bash + # 1. Read the current action id from the rendered page + curl -s http://localhost:/login | grep -o '\$ACTION_ID_[a-z0-9]*' + # 2. Submit with that id as an empty multipart field, alongside the real form fields + curl -s -c /tmp/cookies.txt -X POST http://localhost:/login \ + -F '$ACTION_ID_=' \ + -F 'email=admin@aushilfsfahrer.local' \ + -F 'password=Admin123!' \ + -L -o /tmp/response.html -w "HTTP_STATUS:%{http_code} FINAL_URL:%{url_effective}\n" + # 3. Reuse the cookie jar for subsequent authenticated page fetches: + curl -s -b /tmp/cookies.txt http://localhost:/dashboard + ``` + A test admin user already exists in the local Supabase CLI dev stack (`npx supabase status` from the repo root to confirm it's running) for exactly this purpose: `admin@aushilfsfahrer.local` / `Admin123!`, profile name `Admin`, role `admin`. Also note: this worktree's `web/.env.local` (gitignored) must point at the local CLI dev stack (`http://127.0.0.1:54321` + the real anon key from `npx supabase status`), not the master Docker-Compose stack — verify this first if login curls return `E-Mail oder Passwort ist falsch.` despite correct credentials. ---