feat: GDPR data export and account deletion workflow#143
Draft
feat: GDPR data export and account deletion workflow#143
Conversation
- Add GET /api/users/me/export for user data export (JSON download) - Add POST /api/users/me/delete for account deletion with email confirmation - Add Data & Privacy section to UserProfilePage with export/delete UI - Audit log both export and delete actions for compliance - Rate limit export and delete endpoints - Anonymize audit logs on deletion (preserve compliance trail) - Delete all related rows: sessions, accounts, roles, memberships, todos, comments, referrals Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com> Agent-Logs-Url: https://github.com/thinkdj/ottabase/sessions/fe0d523c-ad1c-4f50-baf5-979a39006005
Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com> Agent-Logs-Url: https://github.com/thinkdj/ottabase/sessions/fe0d523c-ad1c-4f50-baf5-979a39006005
…tity, remove session note Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com> Agent-Logs-Url: https://github.com/thinkdj/ottabase/sessions/fe0d523c-ad1c-4f50-baf5-979a39006005
Copilot
AI
changed the title
[WIP] Add GDPR-style export and delete my data workflow
feat: GDPR data export and account deletion workflow
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No standard "download my data" or "delete account" workflow existed across packages. This adds GDPR Article 17 (erasure) and Article 20 (portability) support.
Backend —
worker/routes/user-data.tsGET /api/users/me/export— Collects user data across all registered models (profile, accounts, sessions, roles, memberships, audit logs, todos, plus conditionally comments/referrals if enabled), strips sensitive fields (passwordHash, OAuth tokens), returns as downloadable JSON.POST /api/users/me/delete— Cascading delete of all user-owned rows after email confirmation. Audit logs are anonymized rather than deleted to preserve the compliance trail.Both endpoints are rate-limited and session-authenticated. Deletion requires the user to echo their email address back.
Frontend —
UserProfilePage.tsxNew "Data & Privacy" card added to existing profile settings page:
/after deletion to clear all client stateRoute wiring —
router.tsTwo new route entries in the existing method dispatchers.
Tests — 11 unit tests
Covers auth gates, email mismatch rejection, sensitive field stripping, audit log anonymization, and the happy path for both export and delete.
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.