Guide
The confirmation link in my sign-up email opens localhost
How this guide was made: Written with AI assistance and checked against the sources linked on this page.
Updated
Short answer: the confirmation link opens localhost because your sign-in service's Site URL is still http://localhost:3000, or your live address is missing from the Redirect URLs allow list. In Supabase, open Authentication, URL Configuration, set Site URL to your live address, add it to Redirect URLs, and pass emailRedirectTo when signing up.
A new person signs up, opens the confirmation email, taps the link and gets "This site can't be reached", a localhost address, or your preview instead of your app. Most stop right there.
Why it happens
Your sign-in service decides where the email link sends people. When your app does not name an approved address, it falls back to one default, often still the builder's local address.
Possible causes
- The default address (Site URL) is still the local one. Supabase's own guide says to change it from localhost to your production address, and Bolt says its default does not work for live apps.
- Your live address is not on the approved redirect list, so the service falls back to the default.
- The preview or local address is written into the app's own code.
- A setting was changed but the sign-in service is still running with the old one (we saw this once, in the linked case).
How to fix it (Supabase)
- In the Supabase dashboard open Authentication, URL Configuration.
- Set Site URL to your live address, for example https://yourapp.com (https, no trailing slash). Supabase says this setting is critical for email confirmations and password resets.
- Under Redirect URLs add your live address with a wildcard, for example
https://yourapp.com/. Keephttp://localhost:3000/only if you still develop locally. - In the sign-up code, pass the live address so the link never falls back to the default:
supabase.auth.signUp({ email, password, options: { emailRedirectTo: 'https://yourapp.com/welcome' } }). The address must match an entry in Redirect URLs, or Supabase uses the Site URL instead. - Open Authentication, Email Templates, Confirm signup. If the link is built from {{ .SiteURL }}, step 2 fixes it. If it uses {{ .ConfirmationURL }}, the redirect_to part comes from step 4.
- Search the app's code for "localhost" and for the preview address, and replace any hard-coded one with the live address.
How do I check it's fixed?
- Open your live app in a private window and sign up with a new address.
- Open the email and long-press or hover over the link: the redirect_to part (or the start of the link) shows your live address.
- Tap it: you land on your live app, signed in or on the confirmation page, not on localhost or the preview.
You can't see it yourself
You're signed in, your customers aren't. You are already signed in, so you never receive that email. On your own computer a localhost link might even open.
Related: Case: sign-up emails still linked to localhost although the settings looked right · The sign-up confirmation email never arrives · Sign-up or login broken after publishing: users bounce back to login or land on localhost
Sources (official documentation)
- Supabase: Redirect URLs
- Supabase: Email templates
- Supabase troubleshooting: Why am I being redirected to the wrong URL when using auth redirectTo option?
VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Firebase, Stripe and Vercel are trademarks of their owners.
Want it fixed for you? For apps built in Lovable or any app whose code is on GitHub, VibeFix's AI agent can find the cause of this error, fix it in your code and re-check your live app. Start with a free check: https://vibe-fixer.com
More guides · Shopify store accessibility · About · Your privacy choices