Vibe Coding Rescue

Authentication in Vibe-Coded Apps: 8 Holes Around the Login That Works

8 min read | Updated September 2026

Login is the one part of a vibe-coded app that almost always works — Supabase Auth, Firebase Auth, Clerk and NextAuth make the happy path a single prompt. The holes are everywhere around the happy path: what happens on reset, on verification, on logout, on the second device, on the account someone else is trying to take over. Here are the eight we find most often, each with the two-minute check.

Try these on your own app tonight

(1) Request a password reset, use the link, then use the same link again. (2) Sign up with a made-up email and see whether you can use the app before verifying. (3) Log in on two browsers, change the password in one, and see whether the other stays logged in. (4) Type a wrong password twenty times in a row and see whether anything slows you down. Any “yes” is a hole.

The eight holes

1
Unverified accounts can do real things
Verification is switched off “for testing” or the app doesn’t check the verified flag. Cost: spam signups, abuse of anything that costs you money, and impersonation of real addresses. Fix: require verification before anything beyond viewing the verify-your-email screen; gate expensive actions on it server-side.
2
The signup form reveals who has an account
“That email is already registered” on signup or reset. Cost: anyone can check whether a specific person uses your product — a privacy problem for some products and a targeting tool for phishing. Fix: same neutral message either way (“If that address exists, we’ve sent a link”).
3
Reset links that don’t expire or can be reused
Managed auth providers handle this correctly by default; hand-rolled reset flows (the AI sometimes writes its own to “keep it simple”) usually don’t. Fix: one-time, short-lived tokens, invalidated on use and on any password change. Better: delete the custom flow and use the provider’s.
4
Changing a password doesn’t log out other sessions
The whole point of changing a password after a scare is to kick out whoever else is in. Fix: revoke other sessions on password change (most providers expose a “sign out everywhere” call), and offer it as a button.
5
No rate limiting on login, reset or signup
Twenty wrong passwords in a row with no slowdown means a script can try twenty thousand. Fix: provider-side limits where available, plus your own per-IP and per-account throttles on those three endpoints. Item 11 on the security checklist.
6
Session or role stored where the client can edit it
An isAdmin flag in local storage or an unsigned cookie; a role the client can write to its own user document. Cost: anyone is an admin. Fix: roles live server-side (custom claims, a server-only column) — see Supabase RLS / Firebase rules.
7
“Sign in with Google” and email/password create two different users
Same person, two accounts, two sets of data, and support tickets you can’t explain. Fix: account linking by verified email — and decide the policy deliberately, because auto-linking on an unverified email is itself an account-takeover vector.
8
Deleting an account doesn’t delete the data
The auth user goes; the rows stay, sometimes still reachable through shared links. Cost: a GDPR/CCPA problem and a trust problem. Fix: a server-side deletion routine that cascades through every table and bucket, plus a written note of what you retain and why.

Use the provider, all the way

The single best auth decision for a vibe-coded app is to stop hand-rolling anything. Supabase Auth, Firebase Auth, Clerk, Auth0 and NextAuth/Auth.js all get holes 1–5 right out of the box if you use their flows. The trouble starts when the AI writes its own reset endpoint, its own session cookie, or its own “remember me” — because those were the simplest things to write that made the demo pass. Ask the tool directly: “Which parts of authentication in this codebase are custom rather than provided by [provider]?” and then replace them.

When it’s already been exploited

If you suspect an account takeover has happened: force a password reset for the affected users, revoke all sessions, rotate the session secret if you have one, and read your auth provider’s logs for the window. Then fix the hole before communicating — a “we’ve fixed it” message that isn’t true is worse than a slower one. If this coincides with a leaked key, rotate that first.

FAQ

Do I need two-factor authentication?
For admin accounts, yes, today — most providers make it a toggle. For every user, offer it once you handle money or sensitive data; make it mandatory only if your customers expect it.
Is magic-link / passwordless login safer?
It removes password reuse and brute force, but it makes the inbox the account — and it inherits every hole above around verification and link expiry. Good choice for most consumer apps; still run the four checks.
Should I store sessions in local storage?
Prefer the provider’s default (usually httpOnly cookies for server-rendered apps). If a token has to live in the browser, keep it short-lived with a refresh flow, and never put roles or entitlements in it that the server doesn’t re-check.
How long does an auth review take?
Half a day for the eight checks and the custom-code inventory; a day or two to replace hand-rolled parts with the provider’s. It’s a standard component of our 12-point audit.

Want the auth flows tested properly?

Half-day auth review for AI-built apps: the eight checks, an inventory of hand-rolled auth code, and the replacements done with your provider’s flows.

Book an Auth Review →

Engineering Insights

Latest from Syntaxa Studio.

Loading latest posts