What problem does it solve?
Supabase authentication can still lead to broken sign-in flows or insecure data access when OAuth callbacks, session refresh, and Row Level Security (RLS) policies are missing or miswired.
Core Features & Use Cases
- Supabase SSR session management: Uses @supabase/ssr to create server and browser clients that correctly read/write session cookies in Next.js.
- OAuth callback that makes sign-in work: Enforces the mandatory app/auth/callback/route.ts to exchange the one-time OAuth code for a session.
- Reliable session longevity: Adds middleware that refreshes the session on every request to prevent silent logouts mid-usage.
- RLS-first security: Ensures authenticated access is safe by requiring RLS and policies that scope rows to auth.uid().
- Use case: An app with multiple users needs GitHub/Google sign-in, persistent sessions during active browsing, and guaranteed per-user data isolation in database queries.
Quick Start
Install the Architect pattern skills for your Next.js project by running architect init . in your codebase, then follow the generated guidance to create app/auth/callback/route.ts, add middleware session refresh, and implement RLS policies tied to auth.uid().