Skip to content

feat(account): in-app account deletion - #705

Merged
kipavy merged 2 commits into
devfrom
feat/delete-account
Oct 23, 2026
Merged

kipavy merged 2 commits into
devfrom
feat/delete-account

Conversation

@kipavy

@kipavy kipavy commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Google Play requires that an app which lets users create an account also lets them delete it from inside the app. The server already exposes DELETE /v1/auth/account, but nothing in the app called it.

What

  • deleteAccount() in src/services/account.ts sends DELETE {server_url}/v1/auth/account through fetchAuth (Bearer JWT, refresh on 401, no body). On a 204 it runs the existing logout(). On any failure it throws and leaves the session alone, because the account still exists. deleteAccountFailure() turns the server's coded refusals into messages:
    • 409 OWNS_TEAM_WITH_MEMBERS: names the teams that still have other members and tells the user to remove those members or delete the team, then try again. The server has no ownership-transfer endpoint.
    • 502 SUBSCRIPTION_CANCEL_FAILED: the subscription could not be cancelled, so the account was kept. Try again later or contact support.
    • Anything else: a generic message with the HTTP status.
  • DeleteAccountModal (src/components/shared/) is built on ConfirmModal:
    • It says the cloud account, the encrypted vault and cloud sync data are deleted, and that the user leaves their teams.
    • It says this device is then signed out and its local copy is erased (logout() runs vault_reset). Copies on other devices are not removed remotely.
    • When billing is enabled and a subscription is still set to renew, it says the subscription is cancelled with the account, so it will not renew.
    • The user must type their account email to confirm (case-insensitive), or DELETE if no email is stored on the device.
    • On success it shows a toast plus a confirmation step that stays open until dismissed. Desktop then reloads, as Sign out does. Mobile pops the page.
  • Entry points, both available only for server mode accounts and with no distribution gating:
    • Desktop: Settings → Account, "Delete account" danger row under "Sign out of cloud account".
    • Mobile: Account page, a red "Delete account" button under "Sign out".
  • i18n: shared.deleteAccount.* in en, fr, cs, ru, tr and zh.
  • Tests: src/utils/deleteAccount.test.ts covers the confirmation logic, the renewing-subscription check and the error-code mapping. src/services/account.deleteAccount.test.ts checks the request, that a successful delete signs the device out, and that a 500, a 409, a 502 or an expired session leave the device untouched.

Depends on the server

VoltiusApp/server#115 makes the server cancel a renewing Lemon Squeezy subscription as part of the deletion, and stop failing with 500 for team users. That PR returns the coded errors above. Ship that server change before or together with this one. Against the old server, the note about the subscription would be wrong, and team users would see the generic error.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Ly4RP96nLUnj4FWtWthpE

Google Play requires apps with account creation to offer in-app account
deletion. Adds a "Delete account" danger action to the desktop Account
settings and the mobile Account page, available in every build.

The dialog calls DELETE /v1/auth/account through fetchAuth, requires the
account email (or DELETE without one) to be typed, warns when a Lemon
Squeezy subscription would keep renewing (the server does not cancel it),
and on success signs the device out through the existing logout path,
shows a toast and a confirmation step. Failures leave the session intact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Ly4RP96nLUnj4FWtWthpE
…ng warning

The server now cancels a renewing subscription as part of account
deletion (VoltiusApp/server#115) and refuses with coded errors instead
of a bare 500:

- 409 OWNS_TEAM_WITH_MEMBERS: say which teams still have members and
  to remove them or delete the team first.
- 502 SUBSCRIPTION_CANCEL_FAILED: say the account was kept because the
  subscription could not be cancelled.

The "deletion does not cancel your subscription" warning and its billing
link become a short note that the subscription is cancelled with the
account. Strings in en, fr, cs, ru, tr and zh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Ly4RP96nLUnj4FWtWthpE
@kipavy
kipavy merged commit 9edeb86 into dev Oct 23, 2026
5 checks passed
@kipavy
kipavy deleted the feat/delete-account branch October 23, 2026 15:37
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