Two-factor authentication (2FA)

    What is two-factor authentication (2FA)?

    SHORT ANSWER

    Two-factor authentication (2FA) adds a second step to logging in, usually a short code from an app on your phone, on top of your password. If someone steals or guesses the password, they still cannot get in without the second step.

    Also called: 2FA, MFA, multi-factor authentication

    ON THIS PAGE

    What it means

    A password is something you know. The second factor is something you have, like your phone. An attacker needs both.

    Codes from an authenticator app are stronger than codes sent by text message, because text messages can be redirected to another phone number.

    Why it matters for vibe-coded apps

    The accounts that matter most are not your users' accounts, they are yours: your host, your GitHub, your database and your domain.

    IF THIS IS WRONG IN YOUR APP
    • One stolen password for your hosting or GitHub can give someone your whole app.
    • Reused passwords from other leaked sites are tried against your accounts automatically.
    • Users with sensitive data in your app expect an extra layer.

    Example

    Letting users switch on an authenticator app in a Supabase project.

    ✕ RISKYPassword only
    await supabase.auth.signInWithPassword({ email, password });
    ✓ SAFEROffer a second step with an authenticator app
    const { data } = await supabase.auth.mfa.enroll({ factorType: "totp" });
    // Show data.totp.qr_code, then confirm with the 6-digit code the user types

    Start by turning it on for your own accounts, then offer it to users.

    How to check if your app has this problem

    1. 1Check that 2FA is on for GitHub, your hosting, your database, your domain registrar and your email.
    2. 2Check whether your app offers it, especially for admin accounts.
    3. 3Look at which method you use. Prefer an authenticator app or a passkey over text messages.

    The quicker way: LetMeCheck tests for this automatically, from the outside, the way an attacker would.

    Run a free scan →

    How to fix it

    1. 1Turn on 2FA for every account that can change or host your app.
    2. 2Store the backup codes somewhere safe and offline.
    3. 3Offer 2FA to your users, and require it for admins.
    4. 4Use a managed login service that supports it, rather than building it yourself.
    FIX PROMPT · PASTE INTO YOUR AI TOOL

    Add optional two-factor authentication to my app using the authentication provider I already use (for example Supabase Auth MFA with a TOTP authenticator app). Add a settings page where a user can switch it on by scanning a QR code and confirming a code, and require the code at login once it is on. Don't change anything else.

    Check if your app has this problem

    Paste your website and we'll check for two-factor authentication (2FA) issues and other common issues in AI-built apps. Free, about a minute, and nothing on your site is changed.

    Last updated