1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

[PS-1175] Resolve issue with processReload not executing (#3240)

* Removed check for getBiometricLocked
It always returned false even when no biometrics were used.

* Remove the other check for getBiometricsLocked

* Ensure that biometricFingerprintValidation is reset, when biometrics are disabled

* Removed getBiometricsLocked and setBiometricsLocked
With nothing in the codebase reading the state of getBiometricsLocked, I've removed all places where it was set or saved.

* Refactor execution of reload into a separate method

* Conditonally pass the window object to `BrowserApi.reloadExtension`

* Clarify in comment, that the PIN has to be set with ask for Master Password on restart

* Ensure the process reload is executed on logout

* Use accounts instead of lastActive == null to determine a reload on logout

* Moved identical logic from desktop and browser into system.service

* Simplified check for refresh to handle no accounts found, logout, lock with lastActive longer than 5 seconds
This commit is contained in:
Daniel James Smith
2022-08-05 20:04:27 +02:00
committed by GitHub
parent df7377d305
commit a1e536a5ef
16 changed files with 68 additions and 96 deletions

View File

@@ -276,7 +276,6 @@ export class SettingsComponent implements OnInit {
if (!newValue || !this.supportsBiometric) {
this.biometric = false;
await this.stateService.setBiometricUnlock(null);
await this.stateService.setBiometricLocked(false);
await this.cryptoService.toggleKey();
return;
}
@@ -290,7 +289,6 @@ export class SettingsComponent implements OnInit {
this.biometric = true;
await this.stateService.setBiometricUnlock(true);
await this.stateService.setBiometricLocked(false);
await this.cryptoService.toggleKey();
}

View File

@@ -158,7 +158,7 @@ export class AppComponent implements OnInit {
this.notificationsService.updateConnection();
this.updateAppMenu();
await this.systemService.clearPendingClipboard();
await this.reloadProcess();
await this.systemService.startProcessReload(this.authService);
break;
case "authBlocked":
this.router.navigate(["login"]);
@@ -189,7 +189,7 @@ export class AppComponent implements OnInit {
this.notificationsService.updateConnection();
await this.updateAppMenu();
await this.systemService.clearPendingClipboard();
await this.reloadProcess();
await this.systemService.startProcessReload(this.authService);
break;
case "reloadProcess":
(window.location as any).reload(true);
@@ -470,8 +470,6 @@ export class AppComponent implements OnInit {
this.keyConnectorService.clear(),
]);
await this.stateService.setBiometricLocked(true, { userId: userBeingLoggedOut });
if (userBeingLoggedOut === this.activeUserId) {
this.searchService.clearIndex();
this.authService.logOut(async () => {
@@ -585,21 +583,6 @@ export class AppComponent implements OnInit {
}
}
private async reloadProcess(): Promise<void> {
const accounts = this.stateService.accounts.getValue();
if (accounts != null) {
const keys = Object.keys(accounts);
if (keys.length > 0) {
for (const userId of keys) {
if ((await this.authService.getAuthStatus(userId)) === AuthenticationStatus.Unlocked) {
return;
}
}
}
}
await this.systemService.startProcessReload();
}
private async checkForSystemTimeout(timeout: number): Promise<void> {
for (const userId in this.stateService.accounts.getValue()) {
if (userId == null) {