The #1 reason auth fails after deployment. Learn the 4 configuration changes that fix 90% of production auth issues.
Quick Fix Checklist:
1. Update Supabase callback URLs
2. Configure CORS origins
3. Set production env variables
4. Verify RLS policies
Fixes auth for Vercel, Netlify, and custom domains • Used by 300+ deployed apps
Fix in 15 minutes
Follow these in order. Each step fixes a different layer of the auth stack.
The Problem: Supabase doesn't know your production domain exists, so auth redirects fail or go to the wrong URL.
The Fix:
Example Redirect URLs:
https://yourapp.vercel.app
https://yourapp.vercel.app/auth/callback
http://localhost:5173
http://localhost:5173/auth/callback
Result: Auth redirects now go to your actual production domain instead of failing.
The Problem: Browser blocks requests because your production domain isn't whitelisted in Supabase CORS settings.
The Fix:
https://yourapp.vercel.apphttp://localhost:5173Warning: Using * (allow all) in CORS is insecure for production. Always specify exact domains.
The Problem: Your deployment platform doesn't have the Supabase keys, or they're pointing to the wrong project.
The Fix:
Add these to your Vercel/Netlify dashboard:
VITE_SUPABASE_URL=https://yourproject.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key_here
anon public key (not the service_role key)Result: App can connect to Supabase API from your production domain.
The Problem: Database queries return empty results or 403 errors because RLS policies block production requests.
The Fix:
Example RLS Policy:
CREATE POLICY "Users can read own data"
ON public.users
FOR SELECT
USING (auth.uid() = id);
Note: Disabling RLS "fixes" auth but removes all security. Always use proper policies instead.
Run through this when auth still doesn't work after the 4 steps above.
Most Common Error: If you see CORS error or 403 Forbidden, your CORS origins or callback URLs are misconfigured. Go back to Steps 1 & 2.
Some auth issues require deeper debugging: custom providers, edge functions, complex RLS policies, or session handling. Get expert help to identify the root cause.
Includes: Full auth flow analysis, RLS policy review, deployment configuration audit, and working fix within 48 hours.