AuthApiError: Invalid login credentials (Supabase Auth)

Filed under Supabase & databases

Most likely causeAbout 10 min · 6 steps

The email-and-password pair does not match an account Supabase can sign in — a wrong password, a provider-only account with no password, or an app pointed at a different project.

Find the account in the dashboard
Check its sign-up provider
Reset the password to prove it

Fastest route

Give your AI this prompt

Copy it, replace the bracketed part with your error, and send it.

Preview the prompt
Users of my Supabase app get "Invalid login credentials" (AuthApiError, status 400) when they sign in with email and password, even when they believe the password is correct.

Here is my sign-in code: [paste the signInWithPassword call and the form code around it].
What I see in Authentication > Users in my dashboard for the failing account: [the email, and the provider shown for it — or "the account is not listed there"].

Please: 1) check my code for email cleanup problems (whitespace, case) and fix them at both sign-in and sign-up, 2) tell me how to tell, from the provider shown in the dashboard, whether this account has a password at all, and what my app should do for provider-only accounts, 3) add temporary logging of error.name, error.status, error.message, and error.code so I can see the real failure, 4) tell me how to verify my app's Supabase URL points at the same project as the dashboard I am checking.

Constraints: do not change my auth provider setup, do not disable email confirmation, do not store or log actual passwords, and do not rewrite the whole login page — targeted changes only, and show me each one.

Fix it yourself

Follow the repair

  1. Confirm the account exists — in the right project first. Open your Supabase dashboard, go to Authentication > Users, and search for the exact email. Before you conclude anything from an empty result, confirm this is the project your app uses: compare the project reference in the dashboard URL with the one in your app's Supabase URL (https://<project-ref>.supabase.co). Two projects is the most common setup mistake in all of Supabase debugging, and it produces exactly this error with a perfectly good account sitting in the other project.
  2. Check how the account was created. In that Users list, look at the account's provider. If it says google, apple, or another provider instead of email, the account has no password — password sign-in will fail every time, correctly. Those users must sign in with the same provider button, or set a password first through a password-reset email (step 3), after which both methods work.
  3. Prove the password with a reset. Trigger a reset from the app or the dashboard and set a fresh password:
    const { error } = await supabase.auth.resetPasswordForEmail(email, {
      redirectTo: "https://your-app.com/reset-password",
    });
    Then sign in with the new password. If that works, the account was fine and the old password was the problem. If the reset email never arrives, the email address itself is wrong or the account does not exist under it — go back to step 1 with that knowledge.
  4. Clean the email before you send it. Small input dirt causes a steady share of these. Trim whitespace and normalize case at sign-in (and ideally at sign-up too), and test with a manually typed address rather than an autofilled one:
    const cleanEmail = email.trim().toLowerCase();
    const { error } = await supabase.auth.signInWithPassword({
      email: cleanEmail,
      password,
    });
    Phone keyboards also love to capitalize the first letter of passwords or add a trailing space — if a user swears the password is right, have them type it visibly once, in a notes app, and paste it in.
  5. Log the real error object instead of swallowing it. Many AI-built login forms replace every failure with a generic "something went wrong," which hides this error's useful details. During debugging, print the whole thing:
    if (error) {
      console.log(error.name, error.status, error.message, error.code);
    }
    An AuthApiError at status 400 with this message is a credentials mismatch. A different code — for example one about email not being confirmed — is a different fix entirely (unconfirmed accounts get their own "Email not confirmed" error, so if you see that instead, follow that trail).
  6. Check the account and provider settings in the dashboard. Still stuck? In Authentication > Users, confirm the account is not banned and shows as confirmed. In Authentication > Providers, confirm the Email provider is enabled — if it was switched off while testing something else, every password sign-in fails. And if the account list shows the user was created seconds ago by your own test, delete it and sign up cleanly through the app once, so you are testing a known-good account with a known password.
Why this happensOptional explanation

When someone calls signInWithPassword, Supabase checks the email against its user list and compares the password with the encrypted one stored for that account. If anything fails to line up, you get the same flat answer — "Invalid login credentials," delivered in code as an AuthApiError with status 400. The vagueness is a security feature, but it makes debugging miserable, because a typo'd password, a Google-only account, and an account that lives in an entirely different project all look identical from the outside.

The provider trap is the one that catches AI-built apps most often. Your login page offers both "Continue with Google" and an email form. A user signs up with Google on day one — which creates their account with no password attached — then comes back a week later, tries the email form with some password they invent on the spot, and gets this error forever, no matter what they type. From their side the app is broken; from Supabase's side, everything is working exactly as designed. The second classic is the two-project trap: your app is pointed at your development project while you are checking the user list in the production dashboard, or the reverse.

  • Wrong password: the everyday cause — forgotten, changed elsewhere, or typed with a phone keyboard's autocapitalization.
  • Provider account, no password: the user signed up with Google, Apple, or GitHub and has no password to match.
  • Wrong project: the app's URL and key point at a different Supabase project than the dashboard you are inspecting.
  • Email mismatch: trailing spaces, a typo, or a different email than the one used at signup.
  • Account removed: the user was deleted or banned in the dashboard, or never finished signing up.

Quick answers

Why will it not tell me whether the email or the password is wrong?

On purpose. If the error said 'no account with that email' versus 'wrong password,' anyone could use your login form to discover which email addresses have accounts. Supabase returns one flat message for every mismatch, which is safer — and is exactly why you have to check the dashboard to find the real cause.

My user signed up with Google and now cannot use the password form. Why?

They have no password set, so password sign-in can never succeed for them. Have them use the same provider button to sign in, or send a password-reset email — setting a password through that flow attaches one to their account, after which both methods work.

How do I check whether my app uses the same project I am looking at?

Compare the project reference. Your app connects to https://<project-ref>.supabase.co, and that same reference appears in your dashboard's URL and project settings. If the refs differ, you are debugging a different database of users than the one your app checks — every login will fail no matter what you type.

One fix, every Friday.

One real error, explained in plain English, with the fix — in your inbox every Friday. No spam, no jargon, unsubscribe anytime. Every issue closes with a verse and a word of encouragement.