Mendlark / Guides

Supabase "User already registered" (or sign up silently does nothing): how to fix it

Someone tries to sign up and your app shows AuthApiError: User already registered. Or, more confusingly, the sign up "works": no error, a user object comes back, your app says "check your email", and no email ever arrives. Both are Supabase telling you the email address already has an account. Which one you see depends on whether email confirmation is turned on.

Stuck on this? Get it fixed for €49.

Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.

Get it fixed for €49

1. Why there is sometimes no error at all

With "Confirm email" turned on (Authentication → Sign In / Providers → Email), Supabase does not reveal whether an address is registered, so strangers cannot test which emails have accounts. For an existing, confirmed address, signUp() returns a fake-looking user and no error, and sends no email. With confirmation turned off, you get the clear error instead: User already registered (status 422, code user_already_exists).

2. Detect an existing account in your code

When confirmation is on, the returned user has an empty identities list if the address was already taken. Check for it and show a helpful message:

const { data, error } = await supabase.auth.signUp({ email, password });
if (error) {
  if (error.code === 'user_already_exists') return showSignInInstead();
  return showError(error.message);
}
if (data.user && data.user.identities && data.user.identities.length === 0) {
  return showSignInInstead(); // "You already have an account. Sign in or reset your password."
}
showCheckYourEmail();

Keep the wording neutral, such as "If you already have an account, sign in or reset your password", if you do not want to confirm to strangers which emails are registered.

3. The person signed up with Google first

If the account was created with Google (or another provider), it has no password yet, so email and password sign up and sign in both fail. Offer a "Continue with Google" button on both forms. If they want a password too, they can use "Forgot password" while signed out, or updateUser({ password }) while signed in.

4. The account exists but was never confirmed

For an address that signed up but never clicked the link, calling signUp() again sends a new confirmation email, but only within the email rate limit. If nothing arrives, see confirmation email not sending and email rate limit exceeded. You can also add a "Resend email" button that calls supabase.auth.resend({ type: 'signup', email }).

5. You deleted the test account but it still says registered

Check you deleted the user in the same project your live app uses (compare the project ref in SUPABASE_URL). Users live in Authentication → Users, not in your profiles table, so deleting the profile row does not free the email. If deleting the user fails, a table such as profiles probably references auth.users without on delete cascade. Delete the profile row first, or add the cascade.

6. A trigger is the real problem

If brand new addresses fail too, the email is not the issue. A failing sign-up trigger shows up as "Database error saving new user" and can leave you thinking the account exists. Check Logs → Auth for the real reason.

Quick checklist

  • Know whether "Confirm email" is on in the live project
  • Code checks user_already_exists and an empty identities list
  • Form offers sign in, password reset and Google sign-in
  • "Resend email" button for unconfirmed users
  • Test users deleted in Authentication → Users of the right project
  • Brand new emails sign up without errors

Stuck on this? Get it fixed for €49.

Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.

Get it fixed for €49

Still stuck?

Mendlark fixes this kind of problem for a fixed €49 (launch price, normally €79). We agree the problem first, test the fix and send it as a pull request, so nothing changes in your app until you merge it. If we can't fix it, you don't pay. Get the €49 fix, or start with a free scan.

Not sure what else is wrong? Paste your app link into the free instant check and get a plain-English list of problems in seconds.