Get your API key

Lesson 3 of 5

Remove localhost and fix login redirects

Find hard-coded URLs, set Supabase Site URL and Redirect URLs, match Google redirect URIs exactly, avoid mixed content.

8 min Log in to open
One step at a time, like flipping pages.

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

  1. 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.

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:

  1. Find every hard-coded localhost
  2. Supabase: Site URL and Redirect URLs
  3. Google login: exact match only
  4. HTTP inside an HTTPS site: mixed content
  5. Your URL sheet
  6. Recap