© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
5 replies
Grantly

Auth Admin "Get User by Email"?

I am writing secure (edge function) logic, allowing an admin to create new users on my app [by email]. Needless to say, there could be a case where a user already exists with the chosen email. I am trying to understand how to best handle this scenario.

I cannot find any mention in the documentation of 'retrieve user by email' only 'retrieve user by id': const { data, error } = await supabase.auth.admin.getUserById(1)

I am wondering if there is something I am missing or if it would be bad practice to search for existing application users by email?

Furthermore, I noticed that using to "invite a new user to the applicaiton" (as the docs said):
const { data, error } = await adminClient.auth.admin.inviteUserByEmail(
request_body.email,
);

...will not throw an error if a user already exists with that email.

Thank you for any help as I explore the 'big picture' of this scenario!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Get User by Phone Number or Email (supabase.auth.api)
SupabaseSSupabase / help-and-questions
4y ago
Auth user email changed
SupabaseSSupabase / help-and-questions
5mo ago
How to get id from auth table by email?
SupabaseSSupabase / help-and-questions
4y ago
Fetching user by jwt as admin.
SupabaseSSupabase / help-and-questions
4y ago