57 Commits

Author SHA1 Message Date
cartsnitch-qa[bot] 5c4f0d5c3b Merge pull request #116 from cartsnitch/dev
Promote to UAT: fix(auth) trustedOrigins + latest dev
2026-04-04 04:24:26 +00:00
cartsnitch-qa[bot] d26f25555a Merge pull request #115 from cartsnitch/betty/fix-uat-trustedorigins
fix(auth): add UAT hostname to trustedOrigins
2026-04-04 04:24:09 +00:00
Pawla Abdul bc091fc51b fix(auth): add UAT hostname to trustedOrigins
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-04 04:18:03 +00:00
cartsnitch-engineer[bot] be78b36702 fix(auth): add session table model mapping for plural table name
Better-Auth defaults to singular "session" table name, but our DB uses
the plural "sessions" table (created by migration 002). Add modelName and
snake_case field mappings to match the existing pattern for user,
account, and verification models.

Co-authored-by: Stockboy Steve <steve@cartsnitch.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: cartsnitch-ceo[bot] <269712056+cartsnitch-ceo[bot]@users.noreply.github.com>
2026-03-31 03:42:26 +00:00
Stockboy Steve 201606bef8 fix: generate auth/package-lock.json for Docker build
The auth Dockerfile runs npm ci --omit=dev in the production stage
but there was no lock file, causing Docker build to fail.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-29 19:59:51 +00:00
Coupon Carl de3ee06259 fix: fail fast if BETTER_AUTH_SECRET is not set
Remove hardcoded fallback secret that allowed sessions to be
signed with a well-known value if the env var was unset.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-28 10:03:39 +00:00
Coupon Carl 11245744b3 feat: migrate authentication to Better-Auth (Phase 1)
Replace hand-rolled JWT auth with Better-Auth session-based authentication.

- Scaffold auth/ Node.js service with Better-Auth, bcrypt password compat,
  Postgres adapter mapped to existing users table
- Add Alembic migration (002) creating sessions, accounts, verifications
  tables and migrating password hashes to accounts table
- Update FastAPI auth dependency to validate sessions via shared DB
  (supports both cookie and Bearer token)
- Remove registration/login/refresh endpoints from API gateway (now
  handled by Better-Auth service)
- Update frontend to use better-auth/react client with httpOnly cookies
  (no tokens in localStorage or memory)
- Rewrite auth store, Login, Register, Dashboard, Settings, ProtectedRoute
  to use session-based auth
- Update all tests to create sessions directly in DB instead of JWT tokens

Resolves CAR-27
See plan: CAR-26#document-plan

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-28 04:46:10 +00:00