1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-20 19:34:03 +00:00

Updated references to use decrypt with feature flag

This commit is contained in:
gbubemismith
2025-04-09 17:58:31 -04:00
parent 6f3cbd1c62
commit 9f29cefb78
29 changed files with 85 additions and 98 deletions

View File

@@ -90,9 +90,7 @@ export class EditCommand {
return Response.notFound();
}
let cipherView = await cipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(cipher, activeUserId),
);
let cipherView = await this.cipherService.decryptCipherWithSdkOrLegacy(cipher, activeUserId);
if (cipherView.isDeleted) {
return Response.badRequest("You may not edit a deleted item. Use the restore command first.");
}
@@ -100,8 +98,9 @@ export class EditCommand {
const encCipher = await this.cipherService.encrypt(cipherView, activeUserId);
try {
const updatedCipher = await this.cipherService.updateWithServer(encCipher);
const decCipher = await updatedCipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(updatedCipher, activeUserId),
const decCipher = await this.cipherService.decryptCipherWithSdkOrLegacy(
updatedCipher,
activeUserId,
);
const res = new CipherResponse(decCipher);
return Response.success(res);
@@ -132,11 +131,9 @@ export class EditCommand {
cipher,
activeUserId,
);
const decCipher = await updatedCipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(
updatedCipher,
await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)),
),
const decCipher = await this.cipherService.decryptCipherWithSdkOrLegacy(
updatedCipher,
activeUserId,
);
const res = new CipherResponse(decCipher);
return Response.success(res);