Supabase says "Invalid login credentials" but the user just signed up: what to check

Run a free check: FlowWatch signs up, logs in and runs a Stripe test checkout on your app, then scans for exposed keys. You get a shareable report. Run the free check at flowwatch.org

A user emails you: "I signed up yesterday and now I can't log in." Your Lovable, Bolt or Cursor app shows Invalid login credentials. You try their email yourself and get the same thing.

This one is confusing because Supabase uses one message for several different situations. The signInWithPassword() docs say the error does not tell apart:

  • an account that doesn't exist in this project,
  • a wrong email and password combination, and
  • an account that can only sign in with a social provider (for example Google).

That's deliberate: it stops attackers from finding out which emails have accounts. But it means you have to look up the user yourself. This guide shows how, in about five minutes.

Step 1: Read the error code, not the message (1 minute)

Open your live app, open DevTools → Network, and try the login. Click the request to …supabase.co/auth/v1/token?grant_type=password and read the response body.

error_code in the responseWhat it meansGo to
invalid_credentialsWrong password, no such user in this project, or a social-only accountStep 2
email_not_confirmedThe account exists but the email was never confirmedStep 3
over_request_rate_limit (HTTP 429)Too many attempts from this IP, or a loop in your code firing requestsStep 6
No request to /auth/v1/token, or it goes to a different …supabase.co hostThe deployed build talks to a different project, or the env vars are missingStep 4

In code, supabase-js gives you the same value as error.code. Supabase's own advice is to branch on error.code, not on the message text.

Step 2: Find the user in the dashboard (2 minutes)

In the Supabase dashboard for the production project, open Authentication → Users and search for the email.

  • Not there at all? The signup never created an account in this project. The usual causes: the signup ran against a different project (Step 4), the signup failed and your form showed success anyway (see Database error saving new user), or the user typed a different email (a typo, or a stray space from copy-paste).
  • There, but the provider is Google, GitHub or another OAuth provider? This account has no password. Email-and-password login will always return invalid_credentials. Point them to "Continue with Google", or see Step 5.
  • There, and it says "Waiting for verification"? The email isn't confirmed. Go to Step 3.
  • There, confirmed, with the email provider? Then it's the password. Send a reset (Step 5).

If the account isn't there, also check Logs → Auth around the time they say they signed up. A failed signup usually leaves an error there.

Step 3: The confirmation email never arrived (or was never clicked)

With Confirm email turned on (the default), signUp() returns a user but no session, and login is blocked until the user clicks the link. Your UI has to say "Check your inbox", not "You're in".

Fix it for this user by resending the email:

const { error } = await supabase.auth.resend({
  type: 'signup',
  email,
  options: { emailRedirectTo: 'https://yourapp.com/welcome' },
});

If emails don't arrive at all, Supabase's built-in email sender is the likely cause: it only delivers to members of your Supabase organization and has a low rate limit. Set up custom SMTP before launch. See Why aren't signup confirmation emails arriving?

Also make sure your login screen handles email_not_confirmed with its own message and a "Resend email" button, instead of a generic "Login failed".

Step 4: Preview and production use different Supabase projects

Many AI-built apps end up with two Supabase projects (or a Lovable Cloud backend plus a separate Supabase project). The user signed up on one and logs in on the other, so the account "doesn't exist".

Check:

  1. The …supabase.co host in the Network tab on the live site.
  2. The env vars on your host (Vercel, Netlify and so on) for Production. Frontend env vars are baked in at build time, so redeploy after changing them.
  3. That the project you searched in Step 2 is the one the live site uses.

More on this in Why does login work in my preview but break after I deploy?

Step 5: Give social-only and forgot-password users a way in

A password reset covers both "I forgot my password" and "I signed up with Google but now type a password":

await supabase.auth.resetPasswordForEmail(email, {
  redirectTo: 'https://yourapp.com/update-password',
});

When they open the link, your app gets a PASSWORD_RECOVERY event from onAuthStateChange. Show a "new password" form and call:

await supabase.auth.updateUser({ password: newPassword });

Add https://yourapp.com/update-password to Authentication → URL Configuration → Redirect URLs, or the link will send people to your Site URL instead. Run the whole flow once yourself with a test account (including one that first signed up with Google) before you rely on it.

Step 6: Rate limits and retry loops

over_request_rate_limit means too many requests from one IP. Real users rarely hit it by hand. If you see it, look for a login call inside a React useEffect that re-runs, or a "retry on error" loop the AI added. Fix the loop, then ask the user to wait a few minutes.

Stop it from happening again

  1. Show the right message per error code. invalid_credentials → "Wrong email or password. Signed up with Google? Use Continue with Google. Forgot your password? Reset it." email_not_confirmed → "Confirm your email first" plus a resend button.
  2. Handle repeat signups. If someone signs up again with an email that already has a confirmed account, Supabase doesn't create a second account. When Confirm email and Confirm phone are both on (Confirm phone counts even if phone signups are off), signUp() returns an obfuscated user and no error. When either is off, you get "User already registered". Either way, tell them: "If you already have an account, sign in or reset your password."
  3. Trim the email field before sending it, so autofill and copy-paste spaces don't create mismatches.
  4. Check error on every auth call. supabase-js returns { data, error } instead of throwing, so a failed signup can look like success if the code never reads error.
  5. Test the real flow on the live site after every deploy: sign up with a fresh email, confirm, log out, log back in. A login screen that only you have tested isn't tested.

Quick checklist

  • Read error_code in the /auth/v1/token response
  • Found (or didn't find) the user in Authentication → Users of the production project
  • Checked the provider column (email vs Google/OAuth)
  • Checked confirmation status, resent the email if needed
  • Confirmed the live site uses the same Supabase project you checked
  • Login UI shows different messages for invalid_credentials and email_not_confirmed
  • Password reset flow works end to end on the live site

Catch it before users email you

FlowWatch signs up, logs in and logs out on your live app every day, runs a Stripe test-mode checkout, and emails you when a step breaks and again when it recovers. The first check is free. Run the free check at flowwatch.org


Sources: Supabase JavaScript reference: signInWithPassword (the error doesn't distinguish a missing account, a wrong password or a social-only account), signUp (no session while Confirm email is on; obfuscated user or "User already registered" for existing users), resend, resetPasswordForEmail, updateUser: https://supabase.com/docs/reference/javascript/auth-signinwithpassword; Supabase Auth error codes (invalid_credentials, email_not_confirmed, over_request_rate_limit, email_address_not_authorized; branch on error.code): https://supabase.com/docs/guides/auth/debugging/error-codes.

Questions: hello@flowwatch.org