Files
accountkit/test
CatoandClaude b25e5858ca feat(auth): a product that must keep accounts can turn self-service deletion off (#65)
Vita, a clinic, keeps medical records for ten years under Swiss law: its
patients request erasure from a clinician (a tracked thread), and the portal
has no delete button. Adopting AccountKit's account panel would have given
them one, and /delete-user would have taken the sign-in away from records
the clinic must keep.

- accountDeletion: false (createAuthRuntime, createAuthInstance) turns
  better-auth's deleteUser off: /delete-user answers 404 and deletes nothing.
- AccountPanel takes `deletion`, the product's own way out (such as a link to
  its erasure request), shown in place of the delete control beside
  "Sign out".

Both have regression tests: the endpoint refuses with every row and the
session intact, and the panel renders the product's node, not the control.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 21:31:18 +01:00
..