<p dir="auto">Account deletion is something that administrators currently do manually, when emailed with a request, but there's no reason to prevent users from being able to delete their own accounts.</p>
<p dir="auto">I'm opening this as a draft PR in order to get early feedback on the UI. Obviously tests need to be written, and to help with development, it doesn't actually delete the account yet <g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>
<p dir="auto">The idea is to have a button on the account editing page:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/360803/146233151-6d921bb3-994d-4b8f-b9dd-31896d8d51ad.png"><img src="https://user-images.githubusercontent.com/360803/146233151-6d921bb3-994d-4b8f-b9dd-31896d8d51ad.png" alt="Screenshot from 2021-12-15 16-59-00" style="max-width: 100%;"></a></p>
<p dir="auto">Which then leads to a description of what exactly will happen when you delete your account:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/360803/146232783-2c53d980-aefa-4ed6-b95f-5adbe36d876f.png"><img src="https://user-images.githubusercontent.com/360803/146232783-2c53d980-aefa-4ed6-b95f-5adbe36d876f.png" alt="Screenshot from 2021-12-15 16-54-42" style="max-width: 100%;"></a></p>
<p dir="auto">Please let me know what you think. If you want to see exactly what happens when you delete an account currently, have a look at the reasonably straightforward <a href="https://github.com/openstreetmap/openstreetmap-website/blob/8adb486130d867070504c2c2c705fdfe74e5d394/app/models/user.rb#L243-L259"><code>User#destroy</code></a> method.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/3398'>https://github.com/openstreetmap/openstreetmap-website/pull/3398</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/commits/a8e8ba1a64d4f82c74003b5fc05c6fc89a10cc65" class="commit-link">a8e8ba1</a>  Refactor the account edit/update pages out into a separate accounts controller</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/commits/1a260d879dec3031dd0aa86578b4b0803e8e6dd9" class="commit-link">1a260d8</a>  WIP Allow users to delete their own accounts</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files">21 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-29beaabe278fd17493296745cecb67919f0906b47b8246ab770f5517615d9ef7">.rubocop_todo.yml</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-debf59904131dc89a88ab44cbb1d6deaaa5a7d70c0507f674080df62f7c8e41f">app/abilities/ability.rb</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-02739344243c100a83779d064913eab2c537d6c5c5910abd7629c1ec91486df2">app/controllers/account/deletions_controller.rb</a>
    (12)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-25fe163085ea55de795324d01f141d5e4de00c6a2d3035d75c6e0768af679a2e">app/controllers/accounts_controller.rb</a>
    (59)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-766c34fd6533171eaf54300c153f89d6002c35c02cfc9c5b219251f85180ad07">app/controllers/application_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-7aef2ace328700051fb00c64431397ca324c650157bf5ddab585023b4e8652d5">app/controllers/concerns/user_methods.rb</a>
    (47)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-961c5d7e0310073ca00d502eda2687808102441be660a654cab29645fbcea019">app/controllers/confirmations_controller.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-cfdccd0a9d5df5a43aaad2a35d36ebbe187c52ad5fdc9846fa189d04537adb6e">app/controllers/users_controller.rb</a>
    (89)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-8f87f7dfdba7dbded094bab5b6fa14deac0258fe482f50b79db021bbd4f28786">app/views/account/deletions/show.html.erb</a>
    (37)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-e60a309ef4c891e6cb7845dfcb970684e61c569372bb66ea1ac9c3a16e699eac">app/views/accounts/edit.html.erb</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-90d570948841d78bc3498101a4090ca4b95c73dad7762210d46cff8e1343a262">app/views/application/_settings_menu.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-6d2ef58207c92d1533287af551a075122ba98240a861819047a2ae77b7674f0b">app/views/layouts/_header.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-5654cfc158c888a40321c1e90f9ea3a0208ae80616b15ff0fa5e939b8f795e87">app/views/sessions/new.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-72904e21fa88b5df05388f6fc78d8b4c0e8ee2c7135b6bb46b6ed5a4b50d7d7a">app/views/site/edit.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-78ff736409d758722403cce31873ba803b3fb526d37398ca21caa557b54dfd95">app/views/users/show.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7">config/locales/en.yml</a>
    (82)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
    (7)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-42f978077b25d17cae9dd23c5ad1bbdae876875f7f32e5b9630f316034d25885">test/controllers/accounts_controller_test.rb</a>
    (128)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-0d2e03e45f001516dac5c734d8c0cdbff7a73028598ed5d2f9f8623e52c6099e">test/controllers/confirmations_controller_test.rb</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-2719d3c650da3c587f727ca3c105e6bc93a7113f85717bb15983543cf4f85ae5">test/controllers/users_controller_test.rb</a>
    (140)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398/files#diff-b06fdb1b027508cfa9d420409eeb1db54c3e81d51e16c5a6b55a53cb05efe047">test/integration/client_applications_test.rb</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3398.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3398.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3398.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3398.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3398">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJF7OAXI6GDLGX67V3URDEHRANCNFSM5KEFRLAQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAK2OLNWAF7HLDLYUVGYWOTURDEHRA5CNFSM5KEFRLA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QDTEICQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3398",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3398",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>