By the end of this lesson your live site will never send anyone to localhost, and email and Google logins will land back on the right site in every environment.
You need: an app with Supabase Auth (email or Google login), your preview and production links from Lesson 1, your coding agent · Time: 8 minutes
This one catches almost everyone on their second deploy. On your laptop, login works. On the live fee tracker, one of these happens:
- After logging in, the browser jumps to
http://localhost:3000/...and shows "This site can't be reached". - Google shows Error 400: redirect_uri_mismatch.
- The password reset email links to
localhost, so it only works on your own laptop.
localhost means "this same computer". On your laptop that is your app. On a parent's phone it is nothing. The cause is always a web address written down somewhere and never updated. It hides in three places: your code, Supabase's URL settings, and Google's OAuth settings. This lesson goes through each.
Why?Logins bounce between three systems: your app, Supabase and Google. Each one keeps its own list of allowed addresses, and each list must know your live address.
- After logging in, the browser jumps to
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- Find every hard-coded localhost
- Supabase: Site URL and Redirect URLs
- Google login: exact match only
- HTTP inside an HTTPS site: mixed content
- Your URL sheet
- Recap