← All guides
Supabase auth rescue
Supabase auth redirects to the wrong URL after domain change
SupabaseVPSDomain
Short answer
Auth flows working on the new domain with correct redirect URLs, OAuth callbacks, and email templates.
Why this matters
Login and signup worked on the old URL. After changing the domain, every auth flow redirects back to the old address or returns an error.
Walkthrough
- 01
Find every Supabase auth redirect setting
Supabase has multiple places where redirect URLs are configured.
- Check Site URL and additional redirect URLs in the Supabase auth dashboard.
- List OAuth provider callback URLs (Google, GitHub, etc.).
- Note email template redirect links (magic links, password reset).
- 02
Update Supabase for the new domain
Add the new domain to every Supabase auth setting.
- Update Site URL to the new production domain.
- Add new redirect URLs for each auth flow that needs them.
- Update OAuth provider callback URLs in both Supabase and the provider dashboard.
- 03
Update the app and test
After fixing Supabase, the app also needs correct env vars and a rebuild.
- Update Supabase URL env var on the server if it changed.
- Rebuild the app and deploy the new build.
- Test login, signup, password reset, OAuth, and magic links on the new domain.
Where RepoAssistant fits
RepoAssistant fixes Supabase auth during domain migration so users can log in on the new production URL.