Commit Graph

5 Commits

Author SHA1 Message Date
a893d95387 fix: reliable fs_users upsert on sign-in
ON CONFLICT expression matching was silently failing due to a mismatch
between the query expression and the index definition (::text cast).
Replaced with an explicit SELECT-then-INSERT-or-UPDATE pattern.

Made-with: Cursor
2026-02-27 18:24:47 -08:00
d8ead667d0 fix: create fs_user on sign-in, fix projects fetch
Made-with: Cursor
2026-02-27 12:39:25 -08:00
17056ea00c fix: restore auth fixes — next-auth prisma adapter, serverExternalPackages, prisma db push on start
Made-with: Cursor
2026-02-27 12:30:52 -08:00
e18db985b6 fix: set session cookie on .vibnai.com for subdomain ForwardAuth
Without domain: .vibnai.com the cookie is scoped to vibnai.com only.
Browsers don't send it to theia.vibnai.com, so ForwardAuth sees no
token and redirects to login even when the user is already logged in.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 18:02:06 -08:00
bbb22f1c37 Switch from SuperTokens to NextAuth.js
BREAKING CHANGE: Replace SuperTokens with NextAuth.js

Why:
- SuperTokens had persistent Traefik routing issues
- SSL certificate not issuing correctly
- Complex infrastructure (separate container)
- NextAuth runs in Next.js app (simpler, no separate service)

Changes:
- Install next-auth, @auth/prisma-adapter, prisma
- Create NextAuth API route: app/api/auth/[...nextauth]/route.ts
- Add Prisma schema for NextAuth tables (users, sessions, accounts)
- Update auth page to use NextAuth signIn()
- Remove all SuperTokens code and dependencies
- Keep same Google OAuth (just simpler integration)

Benefits:
- No separate auth service needed
- No Traefik routing issues
- Sessions stored in Montreal PostgreSQL
- Simpler configuration
- Battle-tested, widely used

All authentication data stays in Montreal!

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 15:12:21 -08:00