Commit graph

11 commits

Author SHA1 Message Date
6bdaade777 feat: email verification + Google OAuth
- Signup now creates unverified users and sends a verification email
  (Resend); dev falls back to [VERIFY-LINK] console log
- /api/auth/verify-email: single-use token handler, mints tia_session
  on success, redirects to /onboarding
- /api/auth/resend-verification: rate-limited (3/hr), enumeration-safe
- Sign-in gated on email_verified — unverified accounts get 403 with
  needsVerification flag so the UI can show the resend button
- Google OAuth via arctic v3: PKCE + state anti-CSRF, find-or-create
  user, writes accounts row, mints tia_session
- Login page: Google button, check-email screen, resend link on 403
- drizzle/0005_email_verification.sql: creates email_verifications
  table + backfills all existing users as verified (runs automatically
  on container start before app boots)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 12:56:02 +05:30
e47001365e Rate limit controlled via RATE_LIMIT_ENABLED env 2026-05-17 01:12:15 +05:30
7b6f033d42 Fix UUID join in auth.ts 2026-05-17 00:35:49 +05:30
149d8bc72c auth: fix family_id join with uuid cast 2026-05-16 23:05:20 +05:30
39a93d64e2 Add GET /api/auth/signin for session checking
FamilyProvider calls GET /api/auth/signin to check if user is authenticated after page load.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:30:59 +05:30
f967215fc8 Add email/password authentication
- Add password_hash to users table
- New login flow: email + password
- Sign up / Sign in toggle
- Simple password hashing (upgrade to bcrypt in prod)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 10:37:48 +05:30
35895d226f Auto-create user on signin 2026-05-10 23:48:23 +05:30
31d2c5a29f Fix signin SQL value handling 2026-05-10 23:43:38 +05:30
57e852bfbc Use database sessions with cookie instead of localStorage 2026-05-10 23:40:10 +05:30
1932d2ae6b Fix login flow to store and use real family_id 2026-05-10 23:37:54 +05:30
b4dc29fa3d feat: add signin API and setup route 2026-05-10 05:00:26 +05:30