What problem does it solve? Integrating authentication into a Next.js App Router application is error-prone because of the server/client boundary, token refresh in middleware, and session handling across Server Components, Client Components, and Server Actions. This Skill provides expert guidance to wire Supabase Auth correctly and avoid common mistakes. ## Core Features & Use Cases - Supabase Client Setup: Create properly configured Supabase clients for server and client contexts using @supabase/ssr. - Auth Middleware: Protect routes and refresh sessions in Next.js middleware. - Auth Callback Route: Handle OAuth callbacks and exchange authorization codes for sessions. - Anti-Pattern Detection: Avoid getSession in Server Components, unmanaged client auth state, and manual token storage. - Use Case: You are building a Next.js app with protected dashboard routes. Use this Skill to set up middleware-based session refresh, an OAuth callback route, and Server Actions for sign-in and sign-out. ## Quick Start Set up Supabase Auth in my Next.js App Router project with middleware-protected routes and an OAuth callback handler.