You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Implements full user authentication and dynamic QR-based developer profile
sharing for the DevCard platform.
## What's new
### Backend
- **Password auth** — `POST /auth/signup` and `POST /auth/login` using
Node.js built-in `crypto.scrypt` (zero new dependencies)
- **Zod validation** — email normalised to lowercase, username regex
`[A-Za-z0-9_-]{3,50}`, password min 8 chars
- **Atomic signup** — user + default Card created in a single Prisma
transaction; existing OAuth users unaffected (nullable `password_hash`)
- **Security** — `passwordHash` stripped from every API response
- **Migration** — `20260611120000_password_auth` adds nullable
`password_hash` column
- **Unit tests** — 4 tests: signup, login, duplicate-email 409,
wrong-password 401 (all pass)
### Frontend (SvelteKit)
- **`/signup`** — real-time username format hint, password strength bar
(Weak/Fair/Strong), red/green field borders, spinner on submit
- **`/login`** — friendly 'Email or password is incorrect' message
- **`/dashboard`** — JWT-authenticated page: edit display name, username,
bio, role, company, accent colour; add/edit/delete platform links (GitHub,
LinkedIn, Twitter/X, etc.); live QR code preview; one-click copy URL
- **Landing page** — Log in / Create card CTAs in nav
- **Public profile** (`/u/:username`) — display name now pure white with
accent-colour glow, @username handle shown, role badge and bio lifted
- **Vite dev proxy** — `/auth` and `/api` forwarded to backend; browser
uses relative URLs so no CORS issues
- **Bug fix** — `devcard/[id]/+page.server.ts`: catch variable was shadowing
the imported SvelteKit `error` helper
- **Bug fix** — Svelte 5 reactivity: `$derived` for profile/error props
- **Bug fix** — `apiClient.ts` extracts `details.fieldErrors` from zod
responses so users see exact field messages instead of 'Validation failed'
- **Bug fix** — signup submit was immediately returning because `canSubmit`
included `!loading`; fixed by separating `formValid` from loading state
## Test plan
- All 4 backend auth unit tests pass (`pnpm --filter @devcard/backend test`)
- `svelte-check` — 0 errors
- Manual E2E: signup → login → add links → public profile → QR code all work
Closes: email-auth, profile-management, QR-sharing
0 commit comments