Skip to content

feat: add user-scoped Supabase auth#54

Open
Albert-Gao wants to merge 1 commit intosupabase:mainfrom
Albert-Gao:codex/user-auth-context
Open

feat: add user-scoped Supabase auth#54
Albert-Gao wants to merge 1 commit intosupabase:mainfrom
Albert-Gao:codex/user-auth-context

Conversation

@Albert-Gao
Copy link
Copy Markdown

Summary

  • add verifyUserAuth as a core helper for Supabase user JWT verification
  • default user-token audience validation to authenticated and support optional user ID matching
  • add Hono withSupabaseUserAuth middleware that sets a user-scoped Supabase context without creating an admin client

Why

withSupabase and createSupabaseContext always create supabaseAdmin, which requires SUPABASE_SECRET_KEY. User-facing runtime APIs often only need a verified Supabase user token and an RLS-scoped client, so this adds a narrower path that does not require secret keys in those runtimes.

Validation

  • pnpm exec prettier --check src/adapters/hono/index.ts src/adapters/hono/middleware.test.ts src/adapters/hono/middleware.ts src/core/index.ts src/core/verify-user-auth.test.ts src/core/verify-user-auth.ts src/index.ts src/types.ts
  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build

@Albert-Gao Albert-Gao changed the title [codex] add user-scoped Supabase auth Add user-scoped Supabase auth May 7, 2026
@Albert-Gao Albert-Gao changed the title Add user-scoped Supabase auth feat: add user-scoped Supabase auth May 7, 2026
@Albert-Gao Albert-Gao marked this pull request as ready for review May 7, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant