Skip to content

mix phx.gen.auth: add "Delete Account" button to generated settings page #6412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nbw
Copy link
Contributor

@nbw nbw commented Aug 12, 2025

The Settings page generated with mix phx.gen auth creates a form to update a user's email and another to set a new password. I've been using the generator with a few new apps and I noticed that I had to implement delete account in each case. It feels like this should come out of the box with the generator. Refer to the red "Delete Account" button in the screenshot below.

👋 Note: I've implemented it for the liveview auth flow. I'd be willing to add it to the static template/controller based flow too if the response to this PR is positive.

Screenshots

Screenshot 2025-08-12 at 9 16 31

Demo

demo.mp4

Local testing instructions

  1. Pull phoenix project somewhere locally
  2. create a new phoenix project
  3. update the phoenix dependency (mix.exs) to point to the local copy of phoenix:
# relative path to the local copy of phoenix
{:phoenix, path: "../phoenix", override: true},
  1. Run mix phx.gen.auth Accounts User users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant