Title: Add HTTP endpoint + UI for end users to delete their own account · Issue #352 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Add HTTP endpoint + UI for end users to delete their own account · Issue #352 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Add HTTP endpoint + UI for end users to delete their own account · Issue #352 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary A logged-in user has no way to delete their own account through the running JSS. The data-layer function (deleteAccount(id) in src/idp/accounts.js) and the CLI (jss account delete
Open Graph Description: Summary A logged-in user has no way to delete their own account through the running JSS. The data-layer function (deleteAccount(id) in src/idp/accounts.js) and the CLI (jss account delete
X Description: Summary A logged-in user has no way to delete their own account through the running JSS. The data-layer function (deleteAccount(id) in src/idp/accounts.js) and the CLI (jss account delete <user&...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/352
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add HTTP endpoint + UI for end users to delete their own account","articleBody":"## Summary\n\nA logged-in user has no way to delete their own account through the running JSS. The data-layer function (`deleteAccount(id)` in `src/idp/accounts.js`) and the CLI (`jss account delete \u003cuser>`, #292) both exist, but neither is reachable by the account holder over HTTP, and there's no confirmation UI for what is — by design — a destructive action.\n\nThis is the deletion analogue of #351 (self-service password change). Same auth shape, plus a confirmation step because the action is irreversible.\n\n## Current state\n\n- **CLI:** `jss account delete \u003cuser>` (closed #292) — operator-only, shell required. Supports a `--purge` flag that also wipes the pod's filesystem data.\n- **Data layer:** `deleteAccount(id)` exists; removes account JSON and prunes username/email/webId indexes.\n- **HTTP IDP:** no endpoint. No `/idp` UI to initiate deletion.\n\n## Proposed shape\n\n### Endpoint\n\n```\nDELETE /idp/account\nAuthorization: \u003cexisting session / DPoP>\nContent-Type: application/json\n\n{\n \"currentPassword\": \"...\",\n \"purgeData\": false\n}\n```\n\n- Owner-only — caller's WebID must match the target account's WebID.\n- `currentPassword` is required as proof (matches the password-change pattern in #351).\n- `purgeData: true` mirrors the CLI's `--purge` — also removes the pod's filesystem data after revoking the account.\n- Response: 204 on success, all sessions for the rotated account invalidated, the bearer token used for this request is the last valid one and dies with the account record.\n- 401 wrong password / unauthenticated; 403 cross-account; 404 already gone.\n\n### UI: `/idp/account/delete` (or `/idp/settings#delete`)\n\nAuthenticated HTML form, owner-only, with explicit warning copy:\n\n- \"This permanently deletes account `\u003cusername>` and revokes all sessions and tokens. **It cannot be undone.**\"\n- Checkbox: *\"Also delete my pod data (`\u003croot>/\u003cpodName>/...`) — this destroys all my files on this server.\"* Off by default.\n- Required field: re-enter current password.\n- Optional field: type the username/WebID as a second confirmation (typical destructive-action ergonomic pattern).\n\nServer-side, the form posts to the `DELETE /idp/account` endpoint above (HTML form → JS → DELETE, or a `POST /idp/account/delete` shim that internally maps to the DELETE handler).\n\n## Out of scope\n\n- **Self-service operator → admin elevation** (operator deleting *other* users' accounts via HTTP). Stays CLI-only for now; not the same risk profile.\n- **Single-user mode self-deletion**: in single-user mode there's exactly one account, deleting it bricks the server until restart re-seeds. We probably want to either disable the endpoint in single-user mode, or surface an extra warning about the consequences. Decide as part of implementation; the safe default is to disable.\n- **Federation / Solid-OIDC ripple effects** — type indexes, ActivityPub follows, nostr relays etc. that reference the dead WebID. The deletion endpoint can't reach those; document that the URI becomes a tombstone.\n\n## Acceptance\n\n- New endpoint accepts a valid `{currentPassword}` from the authenticated owner and removes the account record + indexes; returns 204.\n- `purgeData: true` additionally removes the pod's filesystem data.\n- Wrong `currentPassword` → 401, account untouched.\n- Cross-account delete attempts → 403, account untouched.\n- All other active sessions / refresh tokens for the deleted account are invalidated.\n- New `/idp/account/delete` (or equivalent) HTML page, behind auth, with the warning copy and re-entry of password.\n- In single-user mode, the endpoint either 403s with a clear message or follows whatever single-user policy gets agreed in implementation.\n- Tests cover happy path + the failure modes above + the data-purge variant.\n","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-02T21:10:08Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/352"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b8626a3e-b5ac-a202-b2da-36d0d0a33ac7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8380:1A5F61:93A495:C488F5:6B03A2B6 |
| html-safe-nonce | 8381d80535ca525e3fa2d128b2853946c77d5823ea6eb6f4ebfbcdad10bc5cc2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzgwOjFBNUY2MTo5M0E0OTU6QzQ4OEY1OjZCMDNBMkI2IiwidmlzaXRvcl9pZCI6IjM1ODgxNzkzMTkxMjc3Nzc5NzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 521b5fbaaa2c1d8d4ca0d42ec8354303a26718ec2cf0938f0b371e8cfa12a4db |
| hovercard-subject-tag | issue:4370033644 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/352/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8f0ef9d7c6bb9626fb5bee764e85b9d73cd27da357a0eaa81e1cc7b416147c42/JavaScriptSolidServer/JavaScriptSolidServer/issues/352 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8f0ef9d7c6bb9626fb5bee764e85b9d73cd27da357a0eaa81e1cc7b416147c42/JavaScriptSolidServer/JavaScriptSolidServer/issues/352 |
| og:image:alt | Summary A logged-in user has no way to delete their own account through the running JSS. The data-layer function (deleteAccount(id) in src/idp/accounts.js) and the CLI (jss account delete |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width