Supabase Auth sign up

I’m using Supabase Auth for user registration. The issue is that when i try to sign up with an email that has already been registered, Supabase doesn’t return any error. If the email hasn’t been confirmed yet, it keeps sending new confirmation emails. If the email has already been confirmed, Supabase simply does nothing - no email is sent (<- thats not a problem), and no error like “user already registered” is returned (at least, I couldn’t find anything in the logs). I would like to display a message on the screen informing the user that the email is already registered.

Supabase Auth does not provide a direct way to query the auth.users table to check if an email already exists via workflow types. If i were using a custom user table instead of Supabase Auth, i could perform a simple query to check for existing emails. However, since i’m relying on Supabase Auth for authentication, i need an alternative approach to verify if an email is already registered.

You can search the auth.users table with a SECURITY DEFINER type function.

2 Likes

it worked, thanks!

2 Likes