Skip to content

Require password confirmation to delete account #66

Description

@thermcampos

What to build

Deleting an account currently takes a single button click on an inline confirmation. This adds a password gate: after clicking "Delete all my data", the user must type their current password into the confirmation dialog before anything is deleted.

Behaviour:

  • The delete-account endpoint becomes POST /rest/user-sessions/delete-account with a JSON body carrying the password (replacing the current bodyless DELETE).
  • The password is verified before any deletion work begins. On mismatch, the request fails, nothing is deleted, and the failed attempt is recorded against the existing login rate limit (3 failures within 3 minutes locks further attempts), reusing the same machinery as the login flow.
  • On success, deletion proceeds and the rate-limit rows are wiped with the account as they are today.
  • The frontend confirmation dialog gains a password field with a show/hide toggle and an inline error region: wrong password shows an error in place, clears the field, and keeps the dialog open; success signs the user out and clears local storage as it does today.

Acceptance criteria

  • Account deletion with a correct password succeeds end to end
  • Wrong password returns an error; no user data is deleted and the failed attempt is recorded for rate limiting
  • Three wrong attempts within three minutes are rejected by the existing rate limit
  • The confirmation dialog shows the password field with show/hide toggle and displays the error inline on failure
  • Integration tests cover wrong-password (nothing deleted, attempt recorded) and correct-password paths against a real database
  • Frontend updated in sync with the endpoint change (POST with body instead of DELETE)

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions