What’s happening
Every verification, magic-link, invite and reset email contains a link back to your app. Your auth provider or framework builds that link from a setting: the site URL, a redirect URL, or the host your mailer is configured with. When that setting still says http://localhost:3000, every email points at the developer’s own computer.
Sometimes the link itself is hosted, for example https://yourproject.supabase.co/auth/v1/verify?..., and only the page it redirects to afterwards is local. The verification succeeds, then the browser is sent to localhost:3000 and fails. That version is easy to miss, because the email looks fine.
Fix it in Supabase (including Lovable apps on your own Supabase project)
- In the Supabase dashboard, open Authentication → URL Configuration.
- Set Site URL to your live address, such as
https://your-app.lovable.appor your own domain. A new Supabase project starts withhttp://localhost:3000here. - Add every other environment you use (staging, preview domains, localhost for development) to Redirect URLs. Wildcards are supported for preview deployments.
- If your code passes
emailRedirectToorredirectTowhen calling sign-up or sign-in, build it from the current site, for examplewindow.location.origin, or an environment variable. A redirect that isn’t on the allow list falls back to the Site URL. - If you’ve customised the email templates, check they use the template’s confirmation URL or site URL variables rather than a hard-coded address.
Fix it in Firebase Authentication
- Check the continue URL your code passes in its action code settings when sending verification or sign-in links. It should come from the environment, not a hard-coded
http://localhost. - Add your live domain under Authentication → Settings → Authorized domains.
Fix it in other stacks
- Auth.js / NextAuth: set the deployment URL (
AUTH_URL, orNEXTAUTH_URLon older versions) where your host doesn’t infer it. - Ruby on Rails: set
config.action_mailer.default_url_optionswith the righthostin each environment’s config. - Django: build links from the request or the Sites framework, and make sure the site’s domain isn’t still
example.comorlocalhost. - Laravel: set
APP_URLfor each environment. - Anything else: search the code for
localhost:3000and move it into an environment variable.
When the link goes to the wrong site
The same setting causes the same bug on hosted sites. The link works, but on a different site from the one the person signed up on:
- A preview and the published app. A sign-up on
preview--myapp.lovable.appor a Vercel preview whose link goes to the published app (or the other way) confirms the account on one and leaves the person signed out on the other. Add each preview address to the auth provider’s redirect URLs, and build the redirect fromwindow.location.origin. - The platform’s own address. An app on its own domain whose links still go to
myapp.base44.appormyapp.vercel.app: set the site URL to the domain. - Bubble’s version-test. Bubble keeps the development version at
/version-test, with its own data. A confirm or reset link that leads to the live app sends someone testing version-test to a version where their test account doesn’t exist. Check the page the email’s link is built from in the workflow. - Plain http. A link to
http://on a site that uses https: browsers warn, and the token can be read on the way. Set the site URL withhttps://.
Proxy Mail QA compares each verify, sign-in, invite or reset link with the site the account was used on. The inbox and the Accounts row flag one that goes elsewhere, and waits return link_site for tests and coding agents.
On a phone simulator or emulator
The iOS simulator shares your computer’s network, so localhost links open there. The Android emulator doesn’t: it reaches your computer at 10.0.2.2, so a link to localhost:3000 opens nothing. For an emulator, point the app’s links at http://10.0.2.2:3000, or better, at a staging address both can reach. More in Mobile apps.
How Proxy Mail QA flags it
When a link in a test email points at a local address, or redirects to one after verifying, Proxy Mail QA marks it on the Accounts row (“Redirects to localhost:3000”) and explains it in the inbox. You can tell at a glance that the environment is misconfigured, before anyone files it as “verification is broken”.
If you’re testing a local build on purpose, choose This is my dev environment. Links to that host stop being flagged in that project, and the email checks pass them. You can remove it again from the project’s settings. A coding agent can mark the host itself with the MCP tool mark_dev_host, and a test suite with POST /v1/project/dev-hosts (markDevHost in the Node.js client, mark_dev_host in the Python helper).