Michael Bires

Case study

Documented public incident

Documented: Lovable Google Login Redirects to localhost:3000

Based on publicly reported incidents with linked sources — not a fictional client narrative. Describes the real problem and how I fix the same pattern for paying clients.

Subject

Documented: Ishwar Rimal's Lovable + Supabase project (public write-up)

Stack

Lovable, React, Supabase Auth, Google OAuth

Outcome

Root cause = Supabase Site URL still on localhost; fix published Mar 2025

This case study documents a real, published troubleshooting story — not an anonymized client engagement. The pattern appears repeatedly in Lovable community threads and vendor playbooks; it is one of the most common calls I get.

The documented incident

Published: March 25, 2025 by Ishwar Rimal, Senior Frontend Engineer at Intuit, on Medium.

His setup: Lovable frontend + Supabase backend. He added "Sign in with Google."

What worked: Cloning locally and testing on localhost — Google login succeeded.

What failed: On the Lovable preview URL (preview-xyz.lovable.dev), clicking "Sign in with Google" always redirected to localhost:3000.

What he tried first: Updated Google Cloud Console — authorized JavaScript origins and redirect URIs. Still broken.

Actual root cause (his words): "The issue wasn't with Google or my code; it was with Supabase." The Site URL in Supabase Authentication → URL Configuration was still http://localhost:3000. After OAuth, Supabase sends users to Site URL — so every successful Google login landed on localhost regardless of Google settings.

His fix:

  1. Supabase → Authentication → URL Configuration → set Site URL to the Lovable preview URL.
  2. Add production/custom domains to Redirect URLs when deploying.
  3. Confirm Google Cloud has https://<project>.supabase.co/auth/v1/callback.

The article has 6+ claps and remains a top search result for this exact error string.

How common is this?

Multiple independent sources describe the same failure mode:

SourceClaim
Ishwar Rimal (Medium)Preview works locally; preview URL redirects to localhost
RapidDevelopers OAuth guide"Most common mistake is Site URL still http://localhost:3000"
Afterbuild Labs ERR-145"~15% of broken Lovable deployments" — three surfaces must align: Supabase Site URL, Google redirect URIs, client redirectTo

The failure is silent: users see Google consent, click Allow, then hit a dead localhost URL — no obvious error in the app console.

Why custom domain makes it worse

The same pattern triggers when founders connect a custom domain: auth "worked on lovable.app" and breaks on yourdomain.com because Supabase Redirect URLs and Site URL were never updated. That is the production variant of Rimal's preview-URL bug.

How I fix this pattern (my engagement)

When a founder describes "Google login sends me to localhost," I don't start with more Lovable prompts. I align all three surfaces in one pass:

  1. Supabase Site URL + Redirect URLs (preview, production, custom domain with /** wildcards).
  2. Google Cloud (and GitHub, if used) callback URIs.
  3. Code audit for hardcoded redirectTo: 'http://localhost:3000' in shared auth utilities — the layer Ishwar Rimal's story implies but doesn't always show in generated code.

Typical turnaround: same-day for a single-domain fix; $799 Priority Fixes when Stripe webhooks and env vars drifted at the same time.

What you should search to verify

  • lovable google login localhost supabase
  • ishwar rimal lovable google
  • supabase site url localhost lovable

Sources


Same symptoms? Step-by-step fix guide or contact me.

Primary sources

Facing something similar right now?

Tell me what broke and get a fixed-price answer — usually within 48 hours for triage.

Get help with this