OAuth Callback URL Mismatch with GitHub/Google Provider
OAuth authentication fails with error 'redirect_uri_mismatch' or callback page shows blank/error. Users cannot sign in via GitHub or Google because the configured redirect URL doesn't match.
OAuth providers validate that the redirect URL matches exactly what was registered. Any difference in protocol, domain, path, or query parameters will cause the mismatch error.
Error Messages You Might See
Common Causes
- Localhost used in development but https://mysite.com in production config
- Port number mismatch (localhost:3000 vs localhost:5173)
- Protocol mismatch (http vs https)
- Trailing slash differences in callback URL
- Using wrong site domain after deployment
How to Fix It
In Supabase dashboard > Authentication > Providers > GitHub/Google, set redirect URLs:
Development: http://localhost:5173/auth/callback
Production: https://yourdomain.com/auth/callback
Create both entries if supporting both environments. Ensure Vite dev server runs on the exact port configured.
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get HelpFrequently Asked Questions
Do I need HTTPS for callbacks?
Yes for production. Development with localhost HTTP is allowed. All production URLs must use HTTPS.
How do I use different URLs for dev and prod?
Register both URLs in the OAuth provider settings. Use environment variables to switch between them.