StoicBuilder

HandbookIII the CastraSocial sign-in (OAuth)

IIIthe Castra, Stay in control

Social sign-in (OAuth)

1 min readUpdated 28 November

In plain words

Social sign-in lets Google, GitHub or Apple confirm who someone is and pass your app a verified identity, so you never handle their password.

Where you see it

Quill's login page has a "Continue with Google" button. To make it work in Supabase, you enable Google under Authentication, paste in a client ID and secret from Google Cloud, and add your site's address to the allowed redirect URLs.

src/pages/Login.tsxbrowser
await supabase.auth.signInWithOAuth({ provider: "google", options: { redirectTo: `${window.location.origin}/auth/callback` },});
The browser goes to Google, then comes back to an address you've allowed.

What goes wrong

  1. Redirect URLs that only list localhost

    Sign-in works on your laptop and fails on the live site with a redirect error, because the provider only sends people back to addresses on its list.

  2. Treating a Google account as permission

    Google confirms who the person is, not what they may do. Anyone with a Gmail address can sign in, so your app still decides who gets access.

  3. Putting the client secret in browser code

    The client ID is public. The client secret belongs in the Supabase dashboard or your server's environment, never in the frontend.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Set up Google sign-in through our auth provider rather than a custom OAuth flow. List every redirect URL I need to add in Google Cloud and in the auth settings, for both localhost and the live domain, and keep the client secret out of browser code.

Quick check

Sign in to earn +10 XP for it

Google sign-in works on localhost but fails on your live site with a redirect error. Most likely?

Got a prompt that touches social sign-in (OAuth)?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.