Sign in with Apple and Google for Vibe-Coded Apps: What to Get Right

Check your own app — free, in about a minute.

The free mini-scan checks your live homepage for TLS/HTTPS basics, response security headers, cookie flags, exposed sensitive files, Firebase/Supabase backend rules, and the WordPress plugin versions your site exposes. You get a score and the finding titles — no account, no card.

Run the free mini-scan →

Sign in with Apple and Google for Vibe-Coded Apps: What to Get Right

Short answer: social login removes the riskiest thing a vibe-coded app can store — passwords — but only if you implement the four parts builders skip: verify the provider's token on your server, require a verified email before you link or create accounts, protect the flow with a state parameter, and capture what Apple only sends once. Get those right and "Continue with Google/Apple" is the most secure auth most small apps will ever have. Get the email-linking part wrong and you've built an account-takeover feature.

Why social login is the right default for AI-built apps

Ask an AI builder for authentication and you'll get a users table, a password column, and — too often — hashing that ranges from bcrypt down to MD5 or plaintext. Delegating to Apple and Google means passwords, reset flows, and breach liability for stored credentials mostly leave your codebase. The providers verify identity; your job shrinks to verifying their answer correctly. That job is smaller, but it's not nothing.

Rule 1: Verify the token on your server, every time

Both providers hand your app an ID token (a signed JWT). The client sending you an email address proves nothing — clients can claim any email. Your server must:

Any library or hand-rolled code that decodes the token without verifying the signature is a login bypass wearing a trench coat. This is the single most common way "social login" implementations fail.

Rule 2: Link accounts by verified email only

Sooner or later someone signs in with Google using the same email as an existing password account. Merging those identities is good UX — and the most dangerous step in the whole flow.

The attack: some identity providers let users register an email address without proving they own it. If your app merges accounts based on an unverified email claim, an attacker registers the victim's email at a lax provider, signs in, and lands inside the victim's existing account — full takeover, no password needed.

The rule that prevents it: link (or create) accounts by email only when the provider asserts the email is verified — Google's email_verified claim, Apple's verified email from its token. If the email isn't verified, refuse the merge and ask the user to sign in the original way. PreShipIt's own implementation works exactly like this: identity first, verified-email link second, and an unverified email creates and links nothing.

Rule 3: The state parameter is not decoration

OAuth flows are redirect chains, and redirect chains can be started by someone else. Generate a random state value when the flow begins, bind it to the user's browser (a cookie or server-side session), and reject the callback if the returned state doesn't match or has expired. Without it, an attacker can trick a victim's browser into completing a login the attacker started — session-swapping, the login-CSRF classic. Ten minutes of TTL is plenty; the flow either completes promptly or it restarts.

Rule 4: Handle Apple like Apple

Apple's flow has three quirks that break naive implementations:

And a quiet one for both providers: accounts created through social login have no password. Make sure your data model represents that honestly — a sentinel that can never match, not an empty string or a default password — and that "set a password" later requires proving control of the account's email first.

The checklist

Once auth is sound, the rest of your app still faces the internet — a free mini-scan shows what your deployed app exposes from the outside, auth pages included.

Related: Vibe Coding Security Checklist — where auth fits into the full pre-launch pass, sessions and password reset included.

The PreShipIt Brief — a short weekly email for people shipping vibe-coded apps: the week's important vulnerabilities and launch-safety checks, in plain English.

New and free. Double opt-in: we email you a confirmation link before anything else arrives. Unsubscribe any time.

Check your own app — free, in about a minute.

The free mini-scan checks your live homepage for TLS/HTTPS basics, response security headers, cookie flags, exposed sensitive files, Firebase/Supabase backend rules, and the WordPress plugin versions your site exposes. You get a score and the finding titles — no account, no card.

Run the free mini-scan →

← Back home · Run a free mini-scan · Scan my app — $29 · See a sample report