1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-14 07:13:35 +00:00

Add backwards compatability for new local hashing method (#407)

* Add backwards compatability for existing keyHash

* Minor changes for review comments
This commit is contained in:
Thomas Rittson
2021-06-14 14:35:58 -07:00
committed by GitHub
parent d2ca46b6f5
commit d63ee1858d
5 changed files with 40 additions and 29 deletions

View File

@@ -42,9 +42,8 @@ export class ExportComponent {
return;
}
const keyHash = await this.cryptoService.hashPassword(this.masterPassword, null, HashPurpose.LocalAuthorization);
const storedKeyHash = await this.cryptoService.getKeyHash();
if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) {
const passwordValid = await this.cryptoService.compareAndUpdateKeyHash(this.masterPassword, null);
if (passwordValid) {
try {
this.formPromise = this.getExportData();
const data = await this.formPromise;