mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
decrypt saved cipher from server
This commit is contained in:
@@ -419,10 +419,15 @@ export class AddEditComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||||
const cipher = await this.encryptCipher(activeUserId);
|
const cipher = await this.encryptCipher(activeUserId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.formPromise = this.saveCipher(cipher);
|
this.formPromise = this.saveCipher(cipher);
|
||||||
await this.formPromise;
|
const savedCipher = await this.formPromise;
|
||||||
this.cipher.id = cipher.id;
|
|
||||||
|
// 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({
|
this.toastService.showToast({
|
||||||
variant: "success",
|
variant: "success",
|
||||||
title: null,
|
title: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user