Repository navigation
Commit 882b581
committed
feat(users): ✨ GDPR account deletion and personal data export
Members download their data and delete their account from Settings →
Privacy & data; staff delete accounts from the AdminCP; the Debug Panel
tracks every request against GDPR's one-month limit.
API (@vitnode/api)
- core_users_deletions: request tombstone (pending, completed, cancelled,
failed) that outlives the account; one open request per user.
- definePersonalData + buildApiPlugin `personalData`: plugins export and
erase their own rows; core handles its tables (logs, audit, payments).
- Erasure: revoke sessions, delete files, run every plugin's erase and
delete the user in one transaction, then emit user.deleted and email a
goodbye. Failures are recorded and retried hourly up to five times.
- Member routes: GET/POST/DELETE /me/account-deletion (password or recent
sign-in), GET /me/personal-data. Profiles of accounts being deleted 404.
- Admin routes: delete a user (scheduled or immediately), list, summary,
retry and cancel requests; users list `deletion` filter and badge data.
All need the new users:can_delete staff permission.
- Roles: allowDeleteAccount (default on) gates self-deletion.
- Cron: account-deletion (hourly) and ip-retention (daily).
- Config: users.accountDeletion.graceDays (14, max 30) and
users.ipRetentionDays (180). users.ipAddress is nullable.
- Events: user.deletion.requested, user.deletion.cancelled; user.deleted
is now emitted. Audit actions and scheduled/deleted emails.
UI (@vitnode/core)
- Settings → Privacy & data with download and a red danger zone.
- DangerZone component; user page danger zone with delete (optionally
immediately), cancel and retry.
- Users list deletion badge and filter; role form switch.
- Debug Panel: Account deletions tab (checks, needs you, all requests
with a details sheet) and a Privacy requests card on the Overview.
Docs: Account Deletion and Data Export, Export and Erase Plugin Data,
built-in events. EN and PL locales.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CnAiFYkyMmyrtbd7GB46gY1 parent c3afc9c commit 882b581
94 files changed
Lines changed: 6401 additions & 66 deletions
File tree
- apps
- api/migrations
- 20261117174614_gdpr_account_deletion
- 20261117194309_role_allow_delete_account
- web
- content/docs/dev
- events
- working-with-users
- src
- locales/@vitnode/core
- packages
- api/src
- database
- emails
- events
- lib
- account-deletion
- audit
- locales
- middlewares
- modules
- admin
- roles/routes
- users
- routes
- cron
- cron
- users
- routes
- vitnode/src
- components
- locales
- pages
- admin/debug
- settings
- tanstack
- admin
- debug
- roles
- users
- settings
- tests
- views
- admin/views/core
- debug
- health
- sections
- users
- deletions
- detail
- list
- roles
- auth/settings
- privacy
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments