How to set up Supabase Auth in Next.js 15 App Router with shadcn/ui — fully wired Setting up Supabase Auth in Next.js App Router takes about 30 minutes if you understand what you're building. Most tutorials skip the "why" — so you copy the code, it half-works, and you spend hours debugging random logouts and broken OAuth redirects. This guide covers the concepts and the key code. Once you understand the moving parts, the rest clicks into place. TL;DR — The short version 4 files, 30 minutes, full auth Set up a browser client ( createBrowserClient ) for Client Components Set up a server client ( createServerClient ) for Server Components, Actions, and Route Handlers Add middleware to refresh sessions on every request using getClaims() Add a /auth/callback route to exchange OAuth and magic-link codes for sessions Assumes familiarity with Next.js 15 App Router and basic Supabase setup. Works with @supabase/ssr 0.5+. Why...