What you see
Your Lovable, Bolt, v0 or Cursor app has email and password sign-up on Supabase. You test it with your own address and everything works. Then real people sign up, the form shows no error, and when they try to log in they get:
AuthApiError: Email not confirmed
In the Network tab, the request to /auth/v1/token?grant_type=password fails with the error code email_not_confirmed. Supabase’s error code list describes it as: “Signing in is not allowed for this user as the email address is not confirmed.”
Some generated apps hide this behind a generic “Invalid login credentials” or “Something went wrong”, so check the Network tab before trusting the message on screen.
Why it happens
Three Supabase defaults line up against you:
- Confirmation is on. Supabase’s password auth docs say whether users must verify their email to sign in is configurable, and on hosted Supabase projects it’s true by default (it’s false for local development and self-hosting). An app that worked against a local Supabase can start refusing logins once it points at the hosted project.
- Sign-up doesn’t log anyone in. The
signUp()reference in the supabase-js source says that if Confirm email is enabled, “auseris returned butsessionis null”. A lot of generated code sees “no error” and navigates straight to a dashboard that then bounces the user to login, where they’re refused. - The confirmation email never reaches real users. Until you set up your own email provider, Supabase’s SMTP docs say Auth “will refuse to deliver messages to addresses that are not part of the project’s team”, failing with “Email address not authorized”, and the default sender is limited to 2 messages per hour. That’s why it worked for you (you’re on the team) and not for anyone else.
The same docs say the default sender is for exploring, testing templates with your team and demos, and has no delivery guarantee.
If sign-up itself fails with a 500 “Database error saving new user” before any email is sent, that’s a different problem, usually a broken trigger on auth.users: see Database error saving new user.
Fix it
1. Make the confirmation email actually arrive
Open the Auth logs in the Supabase dashboard and find a failed sign-up. If you see “Email address not authorized” or “email rate limit exceeded”, the fix is custom SMTP:
- Pick an email sending service with SMTP. Supabase lists Resend, AWS SES, Postmark, Twilio SendGrid, ZeptoMail and Brevo as working options.
- Verify your sending domain with that provider (it’ll give you SPF and DKIM records; Supabase recommends setting up DKIM, DMARC and SPF).
- In Supabase, open the Authentication settings, enable custom SMTP, and enter host, port, user, password and a From address like
[email protected].
Once saved, Supabase sends to every address, starting at 30 messages per hour, which you can raise under Rate Limits. The email rate limit guide covers that step in more detail.
2. Tell the user to check their inbox after sign-up
Handle the null session instead of assuming they’re logged in:
const { data, error } = await supabase.auth.signUp({
email,
password,
options: { emailRedirectTo: `${window.location.origin}/welcome` },
});
if (error) return showError(error.message);
if (!data.session) {
// Confirm email is on: the account exists but isn't signed in yet
return showMessage('Check your inbox and click the link to confirm your email.');
}
The emailRedirectTo URL must be on your Redirect URLs list in Supabase (Authentication > URL Configuration), or the link sends people to your Site URL, which defaults to localhost:3000.
The same source notes that signing up again with an address that already exists, while confirmation is on, can return an obfuscated user object instead of an error. So “just sign up again” doesn’t fix a stuck account; a resend does.
3. Offer “Resend confirmation email” on the login form
Check the error code, not the message (Supabase recommends error.code over string matching):
const { error } = await supabase.auth.signInWithPassword({ email, password });
if (error?.code === 'email_not_confirmed') {
// show a button that calls:
await supabase.auth.resend({
type: 'signup',
email,
options: { emailRedirectTo: `${window.location.origin}/welcome` },
});
}
auth.resend() with type: 'signup' resends the original confirmation email. It still counts against your email rate limit, so don’t call it automatically in a loop.
A prompt for your AI builder: “On sign-up, if data.session is null show ‘check your inbox’. On login, if error.code is ‘email_not_confirmed’, show a Resend confirmation button that calls supabase.auth.resend with type ‘signup’.”
4. Unstick accounts that are already waiting
For a specific user you know is real (they emailed you from that address, for example), you can mark the email as confirmed from server-side code with the service role key:
await supabaseAdmin.auth.admin.updateUserById(userId, { email_confirm: true });
The admin API source documents this and says only a service role can set it. Never put the service role key in your frontend.
Should I just turn off “Confirm email”?
You can, under the Email provider settings, but think about it first. Supabase’s SMTP docs warn that attackers sign up with addresses they don’t own to push projects into disabling confirmation, and say plainly: “Do not disable email confirmations under pressure.” Without confirmation, anyone can create an account in someone else’s name.
Turning it off also doesn’t rescue accounts that are already stuck. The opener of supabase/supabase #5113 still got “Email Not Confirmed” after switching the setting off (one commenter only got it working by deleting and re-creating the account), and supabase/auth #413 shows users created through the admin API stay unconfirmed unless you pass email_confirm: true. Existing unconfirmed accounts still need step 3 or 4.
Check it worked
- Sign up on the live app with an address that is not on your Supabase team (a fresh Gmail works).
- The app should say “check your inbox”, and the email should arrive (check spam the first time).
- Click the link: you should land on your live domain, not
localhost, and be able to log in. - Try logging in before confirming with another test address: you should see the resend option, not a generic error.
Sign-up flows that only work for the founder are a classic pre-launch surprise. Run the free production-readiness checker on your live URL to catch leftover localhost addresses and exposed keys in your JavaScript. If you want someone to go through sign-up, email delivery, redirects and Row Level Security before real users arrive, get a written pre-launch audit.