Repository navigation
feat(account): in-app account deletion - #705
Merged
Merged
Conversation
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
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.
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()insrc/services/account.tssendsDELETE {server_url}/v1/auth/accountthroughfetchAuth(Bearer JWT, refresh on 401, no body). On a 204 it runs the existinglogout(). On any failure it throws and leaves the session alone, because the account still exists.deleteAccountFailure()turns the server's coded refusals into messages: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.SUBSCRIPTION_CANCEL_FAILED: the subscription could not be cancelled, so the account was kept. Try again later or contact support.DeleteAccountModal(src/components/shared/) is built onConfirmModal:logout()runsvault_reset). Copies on other devices are not removed remotely.DELETEif no email is stored on the device.servermode accounts and with no distribution gating:shared.deleteAccount.*in en, fr, cs, ru, tr and zh.src/utils/deleteAccount.test.tscovers the confirmation logic, the renewing-subscription check and the error-code mapping.src/services/account.deleteAccount.test.tschecks 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