feat(web): add login, register, forgot-password, and verify-email pages#294
Conversation
Implements the W-03 auth pages using react-hook-form + Zod v4.
All forms validate client-side and call confirmed backend endpoints.
JWT tokens are never touched on the client — backend sets HttpOnly cookies.
- lib/api.ts: thin fetch wrapper with credentials:include and envelope unwrap
- (auth)/layout.tsx: minimal auth chrome (logo only, no nav/sidebar)
- login/page.tsx: email+password form → POST /auth/login → redirectTo
- forgot-password/page.tsx: email form → POST /auth/forgot-password (safe msg)
- verify-email/page.tsx: 6-digit OTP → POST /auth/email/verify + resend
- register/page.tsx: 8-step wizard
Step 1 — method selection (Google/Apple disabled, email active)
Step 2 — email + password (full strength validation)
Step 3 — Nigerian phone (+234[789]XXXXXXXXX)
Step 4 — DOB (13+ enforced client and backend)
Step 5 — display name + username → POST /auth/register/email
Step 6 — interests (client-side only, skip available)
Step 7 — bio (optional, max 180 chars, skip available)
Step 8 — store prompt (18+ only) → /verify-email?next=...
No role selection anywhere. No JWT in localStorage. No backend files changed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request introduces a complete authentication system for the web application: an HTTP API client library, a reusable auth layout wrapper, and four pages implementing login, password recovery, email verification, and a complex multi-step registration wizard that validates user data and integrates with the backend. ChangesAuthentication System
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
Builds the W-03 web authentication flow for Twizrr.
This includes:
The flow follows Twizrr’s universal USER model. Store setup remains optional and is not built in this PR.
Type of change
How to test this
Checkout
feat/web-authRun:
cd apps/backend
npx prisma generate
npx tsc --noEmit
Run web checks:
cd apps/web
pnpm run lint
npx tsc --noEmit
pnpm run build
Visit:
/login/register/forgot-password/verify-emailConfirm:
Pre-commit checklist
anytypes addedNotes
The local pre-commit backend TypeScript failure was caused by a stale generated Prisma client. Running
npx prisma generateresolved it without backend source changes.Summary by CodeRabbit