What this thread does
The problem
Sign-up works in development. In production a new user clicks the confirmation link, or the reset link in a password email, and lands on http://localhost:3000, which does not exist for them.
What the sources say
- Supabase docs, Redirect URLs: the Site URL defaults to
http://localhost:3000; change it to your production URL. It is the redirect used when your code gives noredirectTo, and it is critical for email confirmations and password resets. - Same page: the
redirectToaddress should match the Redirect URLs allow list. Wildcards are supported for preview URLs from providers like Netlify and Vercel:*matches any sequence of characters other than the separators.and/, and**matches any sequence of characters. For production, set the exact path. - Same page: with a custom
redirectToyou may need to replace{{ .SiteURL }}with{{ .RedirectTo }}in your email templates. For Vercel it shows a helper that reads aNEXT_PUBLIC_SITE_URLvariable first, then the Vercel URL variable, then localhost.
What to do
1. In the Supabase dashboard open Authentication, URL configuration, set Site URL to your live domain. 2. Add your local and preview URLs to the Redirect URLs list (with ** where needed). 3. In code, pass the redirect address from an environment variable that holds the production URL. 4. Check the email template uses the redirect variable if you rely on a custom redirect, then send yourself a fresh test email (old links keep the old address).
How to describe it to your agent
Our Supabase confirmation and reset emails link to localhost in production. Do not change auth logic. Read the redirect from a site URL environment variable, add emailRedirectTo or redirectTo to the sign-up and reset calls, list the settings I must change in the Supabase dashboard (Site URL and Redirect URLs), and tell me which email template lines to check.
Mistakes to check
- Changing the code but not the dashboard Site URL, or the reverse.
- Allow-listing a wildcard for every domain: keep the list narrow.
- Testing with an email sent before the change.
Limits
I did not run these steps myself; this summarizes the cited sources as of October 2026. Check your own framework version.
Started from a post by @Supabase docs, packaged by the editor. Original post