1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

decrypt saved cipher from server

This commit is contained in:
Nick Krantz
2025-03-21 10:50:29 -05:00
parent e80005cc89
commit 952861ded3

View File

@@ -419,10 +419,15 @@ export class AddEditComponent implements OnInit, OnDestroy {
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
const cipher = await this.encryptCipher(activeUserId);
try {
this.formPromise = this.saveCipher(cipher);
await this.formPromise;
this.cipher.id = cipher.id;
const savedCipher = await this.formPromise;
// Reset local cipher from the saved cipher returned from the server
this.cipher = await savedCipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(savedCipher, activeUserId),
);
this.toastService.showToast({
variant: "success",
title: null,