mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-23386] Fix fix usages of encrypt service (#15476)
* Fix incorrect usages of encrypt service * Add docs * Fix types
This commit is contained in:
@@ -74,11 +74,9 @@ export class BitwardenJsonImporter extends BaseImporter implements Importer {
|
||||
keyForDecryption = await this.keyService.getUserKey();
|
||||
}
|
||||
const encKeyValidation = new EncString(results.encKeyValidation_DO_NOT_EDIT);
|
||||
const encKeyValidationDecrypt = await this.encryptService.decryptString(
|
||||
encKeyValidation,
|
||||
keyForDecryption,
|
||||
);
|
||||
if (encKeyValidationDecrypt === null) {
|
||||
try {
|
||||
await this.encryptService.decryptString(encKeyValidation, keyForDecryption);
|
||||
} catch {
|
||||
this.result.success = false;
|
||||
this.result.errorMessage = this.i18nService.t("importEncKeyError");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user