create api to check if account exists #1858

Closed
opened 2026-03-13 09:08:46 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @proof-llc on GitHub (Sep 5, 2025).

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

It's a popular flow to first enter your email, click continue and then see a different page depending if the email exists in the system. would be great to have an api to check email and see if it exists or not to support this popular flow.

Describe alternatives you've considered

checking database directly.

Additional context

No response

Originally created by @proof-llc on GitHub (Sep 5, 2025). ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like It's a popular flow to first enter your email, click continue and then see a different page depending if the email exists in the system. would be great to have an api to check email and see if it exists or not to support this popular flow. ### Describe alternatives you've considered checking database directly. ### Additional context _No response_
GiteaMirror added the enhancement label 2026-03-13 09:08:46 -05:00
Author
Owner

@Kinfe123 commented on GitHub (Sep 5, 2025):

we throw an error for you with proper error message for that

{"code":"USER_ALREADY_EXISTS","message":"User already exists"}

you can this to be able to do your flow. it is also easier and convenient to do in one round trip as well.

@Kinfe123 commented on GitHub (Sep 5, 2025): we throw an error for you with proper error message for that ``` {"code":"USER_ALREADY_EXISTS","message":"User already exists"} ``` you can this to be able to do your flow. it is also easier and convenient to do in one round trip as well.
Author
Owner

@proof-llc commented on GitHub (Sep 5, 2025):

@Kinfe123 When is such error thrown? when we call signup? you suggest that I create a random password and call to signup a user? and then delete the user since he hasn't agreed to sign up yet. It's very clean if a user already exists, but if user doesn't, it's very hacky and goes against policy - since creating accounts requires users accepting terms and conditions. Or at least, can we make passwords optional - that will make this case less hacky and partially solve https://github.com/better-auth/better-auth/issues/4396

@proof-llc commented on GitHub (Sep 5, 2025): @Kinfe123 When is such error thrown? when we call signup? you suggest that I create a random password and call to signup a user? and then delete the user since he hasn't agreed to sign up yet. It's very clean if a user already exists, but if user doesn't, it's very hacky and goes against policy - since creating accounts requires users accepting terms and conditions. Or at least, can we make passwords optional - that will make this case less hacky and partially solve https://github.com/better-auth/better-auth/issues/4396
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1858