Factory Auth

Auth and authorization conventions distilled across builds with three different auth stacks (Better Auth + orgs, Supabase Auth + RLS, Clerk). Covers the provider decision matrix, the unified wrapper interface (`requireAuth` / `requireRole` / `withOrgContext`), procedure tier stacking, session handling, OAuth callback safety, plugin composition with Better Auth, and the anti-patterns (hardcoded allowlists, admin client at module scope, triple-fallback auth surfaces).

nonlinear-xyz a20e3e4 14.1 KB Updated

File contents

nonlinear-xyz/factory-kit/tree/main/skills/factory-auth commit a20e3e4cf2

Frequently asked questions

npx skillmds@latest add nonlinear-xyz/factory-auth