Skip to content
FirstUser

For builders shipping this week

"Email not confirmed" or "Invalid login credentials" right after signup

Your first real users sign up, then can't log in. FirstUser signs up on your live URL with a brand-new email, confirms it when it can, logs in, and reports which step failed. A failed step includes a screenshot and a fix prompt for Lovable, Bolt or Cursor. Run a free signup test.

You tested login with your own account. That account is old and already confirmed. A stranger's account is neither, so these errors can show up only for them:

1. Email confirmation is on, but your UI acts as if it's off

Supabase's password-based auth guide says you can require users to verify their email before they sign in. On hosted projects that requirement is on by default. In local development and on self-hosted projects it is off by default, which is a common reason it seemed to work on your machine.

The current Dart and Python sign-up references say that with Confirm email enabled, signUp() returns a user and session is null. With Confirm email disabled, it returns both a user and a session. The JavaScript client returns that same auth response. Many generated apps assume a session and redirect straight to /dashboard, where an auth guard can send the user back to login.

Fix: after signUp(), check data.session. If it is null, show a "Check your inbox to confirm your email" screen instead of redirecting. Turn confirmation off only if you are fine with addresses that were not verified. Supabase's general configuration notes that disabling Confirm email treats the address as confirmed without that check.

2. The user tries to log in before confirming

Supabase describes email_not_confirmed as: signing in is not allowed for this user because the email address is not confirmed. The account can exist, and the password may be right, while the confirmation link has not been used yet. Show that in plain words and add a Resend confirmation email button. The resend reference sends the signup confirmation again:

const { error } = await supabase.auth.resend({
  type: 'signup',
  email,
})

email is the address they signed up with. If the link should return to a specific page, the same example also accepts options.emailRedirectTo, and that URL has to be on the Redirect URLs list. This asks Supabase to send the message again. It does not guarantee the message arrives. If it never shows up, see Confirmation email not arriving and Email rate limit exceeded. If it arrives but the link says expired, see Email link is invalid or has expired.

3. "Invalid login credentials" for an account that should exist

Supabase describes invalid_credentials as "Login credentials or grant type not recognized." It is not only a wrong password. Common causes for new users:

  • They signed up with Google and are now trying email and password. That account may have no password. Offer "Continue with Google" on the login page too, or a "Set password" path via password reset.
  • They signed up twice. The JavaScript signUp reference says that if an account already exists, you may get an error message that tries to hide that. The Dart and Python references add a split: when both Confirm email and Confirm phone are enabled, signUp can return an obfuscated user object; when either confirmation is off, the message can be "User already registered". Your UI can say "Check your inbox" again even when no new account was created, and the existing password still applies.
  • The login form trims, lowercases, or otherwise changes the email or password differently from the signup form. Use the same input handling on both.
  • The app points at a different Supabase project in production than in preview (an old VITE_ or NEXT_PUBLIC_ URL or anon key). The account can exist in one project while login runs against the other.

4. You match on the error text instead of the code

Supabase's auth error-code guide says to identify errors with error.code and error.name, not by matching the message string. Generated code often does if (error.message.includes('Invalid')) and shows a generic "Something went wrong" for everything else, so email_not_confirmed can look like a broken app. Map at least email_not_confirmed, invalid_credentials, over_email_send_rate_limit, user_already_exists, and email_exists to human messages. The same guide describes user_already_exists as the user already existing, and email_exists as the email address already existing. If the code is signup_disabled ("Signups not allowed for this instance"), that switch is off for new accounts. See Signups not allowed for this instance.

5. Confirmation works, but the user lands somewhere useless

After the link is opened, the user should be able to continue on your live domain. If they land on localhost, on a preview URL, or on a page that says "please log in", check the Site URL and Redirect URLs in Supabase, and check that the page they land on reads the session. When the host is already your live domain and there is still no session, follow email link opens the site but the user isn't logged in. If a profile row is created by a trigger, also check Database error saving new user. If the form instead shows new row violates row-level security policy for profiles, the auth user was created and the browser insert was rejected. See new row violates row-level security policy on signup.

Test it like a stranger, after every deploy

Open your live URL in a private window, sign up with an email you have never used, try to log in before confirming, then confirm and log in again. Check that each step shows a clear message.

Or let FirstUser do that run: it opens your public URL in a fresh browser, signs up with a new identity, confirms the email when it can, logs in, and opens checkout. If a step fails you get a screenshot, a plain-English diagnosis, and a fix prompt. Run a free signup test.

FAQ

Should I just disable "Confirm email"?

That removes this sign-in block. Supabase then treats the address as confirmed without checking that the person owns it. If you keep confirmation on, handle a null session after signUp and offer a resend button.

Why does it work for me but not for new users?

Your own account may already be confirmed. New accounts on a hosted project go through confirmation when that setting is on, which is the hosted default.

Is this specific to Lovable?

No. An app using Supabase Auth with email confirmation can behave this way, whether it was built with Lovable, Bolt, Cursor, or by hand.

Checklist

Get this checklist by email

We will email this checklist to that address. Privacy policy