You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR moves the claimed-domain guard from AccountsController.Delete into UserService.DeleteAsync(User), so both the authenticated DELETE /accounts path and the anonymous POST /accounts/delete-recover-token path are covered by a single check. I traced every caller of IUserService.DeleteAsync / UserManager<User>.DeleteAsync across src, util, and bitwarden_license — the only two are the controller actions named in the description, and the org-admin path (DeleteClaimedOrganizationUserAccountCommand) deletes through IUserRepository.DeleteManyAsync, so it is unaffected. In the token overload the guard runs after VerifyUserTokenAsync, which keeps the claimed/unclaimed state from being observable without a valid delete token. The error surface for DELETE /accounts is unchanged, since the controller previously threw the same BadRequestException(new CannotDeleteClaimedAccountError().Message).
Code Review Details
No findings.
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
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.
🎟️ Tracking
PM-40493
📔 Objective
Adds a claimed-domain check to
DeleteAsync({single param}), so that both endpoints are covered by the one check:DELETE /accounts-Delete()(was already covered)POST /accounts/delete-recover-token-PostDeleteRecoverToken()📸 Screenshots