All posts

Secure the login of your AI-built app: 7 settings to check

Your login works. People can sign up, sign in and reset a password. But "works" is not the same as "safe". Attackers try thousands of passwords, reuse passwords leaked from other sites, and use bots to create accounts. Much of the protection is a handful of settings in Supabase or Firebase, and they live in the dashboard, not in your app's code. Vendor facts below come from each vendor's own docs, checked in November 2026.

Short answer: Check seven things, in this order: email confirmation, password rules and leaked password protection, auth rate limits, CAPTCHA, multi-factor authentication (MFA) for admins, Firebase email enumeration protection, and session settings. Most take a few minutes in the dashboard. Each has a trade-off for real users, so change one at a time and test sign-in after each change.

1. Confirm email on sign-up

What it protects against: fake sign-ups, and people signing up with an email address that is not theirs. If anyone can create an account with any address and log in at once, you cannot trust the address. That breaks password reset, receipts and invites.

Where it is: Supabase's password auth guide says "You can configure whether users need to verify their email to sign in." On hosted projects "this is true by default". On self-hosted projects and in local development it is false by default. You change it on the Auth Providers page of the dashboard. If your app runs on a self-hosted or local setup, check it yourself.

Trade-off: every new user must open an email before the first login. That costs a few sign-ups. It also depends on email delivery. The Supabase rate limits page says the built-in email provider is limited to "2 emails per hour". That is fine for testing. It is too low for a real launch, so use your own SMTP provider (your own email sending service). Turning confirmation off "for convenience" because emails do not arrive hides the real problem and opens the door to fake accounts.

2. Password rules and leaked password protection

What it protects against: weak passwords and passwords that are already public from other sites' breaches. Attackers try those first. OWASP's Credential Stuffing Prevention cheat sheet covers this attack, where leaked logins from one site are tried on another.

Where it is: Supabase's password security guide says to "Set a large minimum password length." It adds that "Anything less than 8 characters is not recommended." You can also require digits, lowercase and uppercase letters and symbols. Leaked password protection checks passwords against "the open-source HaveIBeenPwned.org Pwned Passwords API" and rejects any that appear in known breaches. The docs say it "is available on the Pro Plan and above." These options are in the Auth settings of your project.

Trade-off: a stricter rule means some users must pick another password. Length helps more than forced symbols, and forced rules annoy people. A long minimum plus the leaked password check is a good pair. On the free plan you cannot use the leaked password check, so a decent minimum length is your main control.

3. Auth rate limits

What it protects against: password guessing, floods of sign-up requests, and email or SMS abuse that costs you money. A rate limit stops one source from trying again and again.

Where it is: the Supabase rate limits page lists what is limited. It includes sign-up and sign-in endpoints per IP, the token endpoint (password, refresh token, ID token and PKCE grants) per IP, OTP and magic link sends per user, and password reset requests per user. Most are customizable. In the dashboard go to Authentication, then Rate Limits. Exceeded limits return a "429 Too Many Requests" error. The page says MFA challenge and verify limits are not customizable. The page does not mention plan-specific limits.

One more point from that page: limits per IP need the real user IP. It describes an "IP Address Forwarding" section and an Sb-Forwarded-For header. If your app calls Supabase from your own server, ask whoever built it whether the user's IP is passed on. If not, all users may look like one IP.

Trade-off: a limit that is too tight blocks real people. Think of an office or a school where many users share one IP. Do not lower the limits just to "be safe". Look at your real traffic first, then change one limit. If a user sees a 429 error, your app should show a clear message, not a blank screen.

4. CAPTCHA on sign-up and sign-in

What it protects against: bots. Supabase's CAPTCHA guide says it supports two providers, hCaptcha and Cloudflare Turnstile. You enable it under Settings, Authentication, Bot and Abuse Protection, then choose a provider, add its secret key and save. Your front end also has to show the widget and send the token, or sign-in will fail. Test this on the live site.

Trade-off: a small extra step for users, and one more service to keep working. For the full guide, see stop fake bot sign-ups in your app.

5. Multi-factor authentication (MFA)

What it protects against: a stolen or guessed password. With a second factor, the password alone is not enough. This matters most for admin accounts.

Supabase MFA

The Supabase MFA guide describes two factors: an app authenticator (TOTP, a time-based one-time password) and phone messaging. The page does not mention a plan requirement. You control access to the enrollment, challenge and verify APIs in the dashboard.

Important: the guide says "Adding MFA to your app's UI does not in-and-of-itself offer a higher level of security to your users." You must enforce it. It describes three options: enforce for all users, for new users only, or only for users who opt in. It also warns that database policies must use as restrictive, or the second factor is not really required. An MFA screen with no rule behind it protects nothing, so check that the rule exists.

Firebase MFA

Firebase's multi-factor guide says you can add SMS MFA "If you've upgraded to Firebase Authentication with Identity Platform." So it is not part of the basic Firebase Authentication setup. The upgrade is a separate step, and you should check the pricing before you turn it on.

Trade-off: users must set up an app and keep a backup. Support requests go up when someone loses a phone. Start with admins and staff. Make it optional for regular users first.

6. Firebase: email enumeration protection and App Check

What enumeration is: Google's email enumeration protection guide describes it as an attack where "a malicious actor attempts to guess or confirm users in a system." The attacker learns which emails have accounts, then targets them with phishing or password guessing. With protection on, invalid sign-in cases return one generic INVALID_LOGIN_CREDENTIALS error, so the response does not tell the attacker which part was wrong.

Is it on? The docs say: "If you created your project on or after September 15, 2023, email enumeration protection is enabled by default." Older projects do not have it turned on automatically. To check, open the Firebase console, Authentication, Settings, User account management, User actions. The box is called "Email enumeration protection (recommended)."

Trade-off: error messages get less specific. Your login form can no longer say "no account with this email". That is the point. Also, if your code uses a lookup of sign-in methods by email, the docs say those lookups stop returning results. Test your sign-in and reset flows after you turn it on.

App Check: Firebase's App Check docs describe it as a service that "helps protect your app backends from abuse by preventing unauthorized clients from accessing your backend resources." The same page lists the services it covers, including Firestore, Realtime Database, Cloud Storage and callable Cloud Functions. It lists Firebase Authentication as "Preview". Think of App Check as a way to make sure requests come from your real app, not a script. It is not a replacement for security rules.

If you use Google or Apple sign-in, see what breaks with social sign-in before you change anything.

7. Sessions: how long people stay logged in

What it protects against: a stolen laptop, a shared computer, or a stolen session. The longer a session lives, the longer it can be abused.

Where it is: Supabase's sessions guide describes three controls: a time-box (a fixed maximum session lifetime), an inactivity timeout, and single session per user. They are in the Auth settings under Sessions, and the docs say they are "only available on Pro Plans and up."

Two details from the docs. Changes do not end existing sessions right away. They are checked the next time a session refreshes. And the effective session length is the timeout plus the access token (JWT) expiry. The docs say to avoid JWT expiry values below 5 minutes.

Trade-off: shorter sessions mean more logins. For a tool that people open every day, that is annoying. For an admin panel or a finance app, it is a fair price. This section covers Supabase only, because the Firebase docs checked for this post did not describe an equivalent setting.

8. Login is not access control

All of the above answers one question: "Is this person who they say they are?" It does not answer: "What may they see and change?" A strong login on top of missing permission rules still leaks data. A logged-in user may be able to read other users' records or reach an admin page. Read admin pages, roles and IDOR in AI-built apps and the database security checks. Do those too.

9. A 15-minute check, in priority order

  1. Confirm email is on (Supabase: Auth Providers page). Send a test sign-up with a fresh address.
  2. Set a minimum password length of at least 8, and longer if you can. Turn on leaked password protection if you are on Pro or above.
  3. Open Authentication, Rate Limits. Read what is set. Make sure custom SMTP is in place before launch.
  4. Turn on CAPTCHA if you see fake sign-ups, and test it on the live site.
  5. Firebase: open User account management and check that email enumeration protection is on, especially for projects created before September 15, 2023.
  6. Add MFA for admin and staff accounts. Confirm that it is enforced, not only shown in the interface.
  7. Pick session limits for sensitive apps (Supabase Pro and above).
  8. Test as a normal user at the end: sign up, confirm, sign in, reset the password, sign out.

Example prompts for your AI tool:

  • "List every Supabase Auth setting this app relies on: confirm email, password length, CAPTCHA, MFA, and rate limits. Tell me which ones I must check in the dashboard, because you cannot see them in the code."
  • "Add a clear message for a 429 Too Many Requests error on the sign-in and sign-up forms. Do not show a blank page."
  • "Add the Turnstile or hCaptcha widget to sign-up and sign-in, and pass the token to Supabase. Do not change anything else."
  • "We show an MFA screen. Check that the database policies use as restrictive and require the second factor for admin actions."
  • "Make the login and password reset forms show the same message whether or not the email has an account."

Want this fixed for you?

I finish and fix apps built with Lovable, Bolt, Cursor or Replit, including making sign-in safer without locking out real users. Send me the details and I'll reply within 24 hours.