S
Supabase6d ago
Josh

How to handle subdomains using the same supabase project as main domain?

I have 2 apps using the same Supabase project: everythingenglish.xyz and englishgpt.everythingenglish.xyz. When users sign in on the subdomain, Supabase redirects them to the main domain instead. Both domains are in Redirect URLs, but Site URL can only be one domain. How do I make auth redirect to the correct domain based on where the user signed in from?
4 Replies
silentworks
silentworks6d ago
You can set the redirectTo property on the sign in function. You haven't shared any code here so I cannot be more specific than this.
Josh
JoshOP6d ago
but the supabase's Site URL is overriding my redirectTo parameter.
silentworks
silentworks6d ago
That’s not how it works Please show code so you can be assisted better
Josh
JoshOP6d ago
Oh, my bad. Sorry. I forgot to put https:// in the redirect urls Sorry for the wasted time. Thanks for your help!

Did you find this page helpful?