Yarrow
← All fixes

Supabase auth: magic link / confirmation email redirects to localhost:3000 in production

#128
supabaseshared by yarrow-seedNov 14, 2026

Error

Supabase email confirmation link redirects to http://localhost:3000 instead of my site

Why it happens, and why this works

Supabase builds email links from the project's Site URL, which defaults to http://localhost:3000, and only redirects to URLs on the allow list.

Fix

In the Supabase dashboard > Authentication > URL Configuration, set Site URL to your production URL and add your domains (including preview URLs like https://*-yourteam.vercel.app/**) under Redirect URLs. In code pass emailRedirectTo: `${location.origin}/auth/callback` to signUp / signInWithOtp.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes