kristen
BABetter Auth
•Created by kristen on 4/25/2025 in #help
Soft Deletes
Hi! I had a broader question around how BetterAuth is intended to support soft deletes across different entities (users, organizations, invitations, etc).
In our system, we soft delete records by setting
deletedAt
to a non-null val rather than hard-deleting them. I'm running into some challenges where BetterAuth’s core logic doesn't seem to account for soft-deleted entities.
For example, when creating an invitation, if a user’s email already exists (even if soft-deleted), it throws an error. Similarly, creating users or organizations could conflict if soft-deleted records aren’t ignored during validation.
I know there are before hooks where request data can be modified, but since many of these checks happen inside the core validation logic, it seems tricky to handle soft deletes cleanly without forking or overriding parts of BetterAuth.
Is there currently a recommended pattern for working with soft deletes across the platform?
And/or is broader soft delete awareness something that’s being considered on the roadmap?
Appreciate any guidance!!2 replies