#9 most commonauthLovableBolt.newCursorReplitv0Windsurf

Login / magic link / email confirmation redirects to localhost

After clicking the confirmation or magic link: This site can't be reached. localhost refused to connect (ERR_CONNECTION_REFUSED)

Got a slightly different error? Paste the exact message and get a fix prompt tailored to it.

Paste your error →

What it means

Your login system still thinks your app lives on your own computer (localhost), so it sends users there after they click the email link. It needs your real website address.

How to fix it: paste this prompt into your AI builder

Fix prompt for Lovable, Bolt, Cursor, Replit, v0, Windsurf
After login/email confirmation users get redirected to localhost. In code, set emailRedirectTo / redirectTo to window.location.origin (plus the callback path) instead of a hard-coded localhost URL. Then tell me exactly what to set in Supabase Authentication, URL Configuration: Site URL = my production domain, and Redirect URLs including the production callback and localhost for development. Don't change unrelated auth logic.

If the AI can't fix it: manual steps

  1. Supabase dashboard, Authentication, URL Configuration: set Site URL to your live domain and add it to Redirect URLs.
  2. Firebase: add your domain under Authentication, Settings, Authorized domains.

Where this happens

Seen in these AI app builders and editors:

LovableBolt.newCursorReplitv0Windsurf

Sources

Related auth errors

Still stuck? Paste your full error and UnstuckMyVibe will match it and hand you the exact fix prompt.

Fix my error →