
Supabase Auth + Next.js: Row Level Security, Magic Links, and OAuth in 30 Minutes
Supabase Auth + Next.js: Row Level Security, Magic Links, and OAuth in 30 Minutes Supabase is PostgreSQL + auth + storage + realtime, hosted. Here's a complete auth setup with RLS in under an hour. Setup npm install @supabase/supabase-js @supabase/ssr // lib/supabase/client.ts import { createBrowserClient } from ' @supabase/ssr ' export function createClient () { return createBrowserClient ( process . env . NEXT_PUBLIC_SUPABASE_URL ! , process . env . NEXT_PUBLIC_SUPABASE_ANON_KEY ! ) } // lib/supabase/server.ts import { createServerClient } from ' @supabase/ssr ' import { cookies } from ' next/headers ' export function createServerSupabaseClient () { const cookieStore = cookies () return createServerClient ( process . env . NEXT_PUBLIC_SUPABASE_URL ! , process . env . NEXT_PUBLIC_SUPABASE_ANON_KEY ! , { cookies : { get : ( name ) => cookieStore . get ( name )?. value , set : ( name , value , options ) => cookieStore . set ({ name , value , ... options }), remove : ( name , options ) =
Continue reading on Dev.to
Opens in a new tab


