1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

[AC-1343] Add bool parameter to conditionally evaluate password after successful unlock (#5260)

This commit is contained in:
Shane Melton
2023-04-21 14:40:56 -07:00
committed by GitHub
parent 89c8c48cd4
commit e777842191

View File

@@ -114,7 +114,7 @@ export class LockComponent implements OnInit, OnDestroy {
const success = (await this.cryptoService.getKey(KeySuffixOptions.Biometric)) != null;
if (success) {
await this.doContinue();
await this.doContinue(false);
}
return success;
@@ -251,19 +251,20 @@ export class LockComponent implements OnInit, OnDestroy {
await this.cryptoService.encrypt(key.key, pinKey)
);
}
await this.setKeyAndContinue(key);
await this.setKeyAndContinue(key, true);
}
private async setKeyAndContinue(key: SymmetricCryptoKey) {
private async setKeyAndContinue(key: SymmetricCryptoKey, evaluatePasswordAfterUnlock = false) {
await this.cryptoService.setKey(key);
await this.doContinue();
await this.doContinue(evaluatePasswordAfterUnlock);
}
private async doContinue() {
private async doContinue(evaluatePasswordAfterUnlock: boolean) {
await this.stateService.setEverBeenUnlocked(true);
const disableFavicon = await this.stateService.getDisableFavicon();
await this.stateService.setDisableFavicon(!!disableFavicon);
this.messagingService.send("unlocked");
if (evaluatePasswordAfterUnlock) {
try {
// If we do not have any saved policies, attempt to load them from the service
if (this.enforcedMasterPasswordOptions == undefined) {
@@ -283,6 +284,7 @@ export class LockComponent implements OnInit, OnDestroy {
// Do not prevent unlock if there is an error evaluating policies
this.logService.error(e);
}
}
if (this.onSuccessfulSubmit != null) {
await this.onSuccessfulSubmit();