Skip to content
SprecherEast
Issue 310

enhancement: Residents can delete their own account from /account

Back to our plan
Open
enhancementauthuxpriority: medium

Type

enhancement

Problem

A resident can't delete their own account. Summary of the owner's requirement (2026-10-24, Claude Code session, text):

Account deletion should be simple to locate and carry out, with suitable identity confirmation and a clear statement of what will be removed.

Proposed fix

  • Where: /account gets a "Delete account" section, at the bottom and clearly labelled.
  • Before deleting: it lists what will be deleted (the account, name, email and saved preferences) and what stays (nothing personal; contact messages follow #274's retention).
  • Confirming who it is: the person re-enters their current password, through the same check as #237. An account with no known password, such as a future social sign-in, confirms through a one-time link to its inbox instead.
  • How it's deleted: with Payload's native delete on users, through the accounts module's server action with explicit overrideAccess and a reason. REST delete stays admin-only.
  • After deleting: the session ends, a fixed confirmation page shows, and a short email says the account was deleted.
  • Which accounts: only resident accounts can delete themselves. Admin and editor accounts are removed by an admin.
  • Data: the related verification record follows #274's retention rules.

Acceptance criteria

  • Not done: A resident can delete their account from /account in under a minute on a phone.
  • Not done: The wrong password is refused with a fixed message. Locked accounts follow #140.
  • Not done: After deletion, sign-in with the old credentials fails and the email can sign up again.
  • Not done: Tests cover an anonymous request, another user's account, and the admin and editor refusal.
  • Not done: It passes the resident-perspective end-to-end test (mobile, wrong input, recovery).

Area

auth, ux

Priority

priority: medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab