Reusing Emails (soft delete feat)
hello everybody,
I’m working on a project using BetterAuth and I have a question about handling soft-deleted users.
In my setup, I have a users module and I’m creating users using the auth.api.signup method (with email/password). I’ve also implemented soft deletion by just toggling a boolean field — if deleted = true, the user is considered deleted.
Now here's my question:
If I soft delete a user (set deleted = true), can I create a new user with the same email address as the deleted one using auth.api.signup? Or is the email still considered “taken” unless I fully remove the user?
would love to hear your feedback on this!
Solution:Jump to solution
Yes it's still considered taken as Better-auth doesn't know that you have a soft-delete feature.
We plan to support soft-delete in the future. In the mean time, I recommend modifying the existing soft-deleted user's email to have a suffix/prefix of some sort so that the email slot opens up for other users to sign up with....
2 Replies
Solution
Yes it's still considered taken as Better-auth doesn't know that you have a soft-delete feature.
We plan to support soft-delete in the future. In the mean time, I recommend modifying the existing soft-deleted user's email to have a suffix/prefix of some sort so that the email slot opens up for other users to sign up with.
I'll try this, thanks for the response!! @Ping