1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-03-12 13:39:14 +01:00

Allow browser extension unlock while desktop is locked

This commit is contained in:
Bernd Schoolmann 2024-07-03 13:04:34 +02:00
parent dc9a6fa9be
commit 4a100f2a09
No known key found for this signature in database

View File

@ -3,7 +3,6 @@ import { firstValueFrom, map } from "rxjs";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
@ -145,11 +144,6 @@ export class NativeMessagingService {
return this.send({ command: "biometricUnlock", response: "not unlocked" }, appId); return this.send({ command: "biometricUnlock", response: "not unlocked" }, appId);
} }
const authStatus = await firstValueFrom(this.authService.authStatusFor$(userId));
if (authStatus !== AuthenticationStatus.Unlocked) {
return this.send({ command: "biometricUnlock", response: "not unlocked" }, appId);
}
const biometricUnlockPromise = const biometricUnlockPromise =
message.userId == null message.userId == null
? firstValueFrom(this.biometricStateService.biometricUnlockEnabled$) ? firstValueFrom(this.biometricStateService.biometricUnlockEnabled$)
@ -183,6 +177,7 @@ export class NativeMessagingService {
}, },
appId, appId,
); );
await ipc.platform.reloadProcess();
} else { } else {
await this.send({ command: "biometricUnlock", response: "canceled" }, appId); await this.send({ command: "biometricUnlock", response: "canceled" }, appId);
} }