feat: verify Clerk tokens in backend, use Supabase for storage

↗ view on GitHub · Claude · 2026-05-20 · a7ea67d0

Complete the Clerk migration on the backend side and consolidate the data
layer onto Supabase so Gary can run without Cloudflare.

- Backend auth: requireAuth verifies Clerk session JWTs via @clerk/backend
  instead of Supabase tokens; Clerk user id flows to res.locals.userId
- Resolve user emails through the Clerk API (cached); the sharing/"people"
  endpoints now look users up via Clerk, not Supabase Auth
- Schema: user_profiles and user_api_keys store the Clerk user id as text
  and no longer depend on auth.users; drop the Supabase Auth signup trigger
- Account deletion removes the Clerk user plus the profile/api-key rows
- Storage: switch the S3 client config from R2-specific env vars to generic
  S3_* vars (with a configurable region) so Supabase Storage works
- Remove the dead frontend storage helper and the unused Supabase JWT helper
- Docs: add docs/SUPABASE_SETUP.md and update env examples / deployment docs

https://claude.ai/code/session_018GMAE164ehpBTxzBdsof9r
Repository zgbrenner/gary
Author Claude <noreply@anthropic.com>
Authored
Parents 5c75082a
Stats 19 files changed , +492 , -292
Part of Auth migration: Supabase Auth → Clerk, with Supabase data/storage layer

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-a7ea67d0.md from inside the repo you want the change in.

⬇ Download capture-commit-a7ea67d0.md