1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-23 03:22:50 +02:00

Allow browser extension unlock while desktop is locked (#9945)

This commit is contained in:
Bernd Schoolmann 2024-07-31 22:16:04 +02:00 committed by GitHub
parent 86acca3bec
commit 3de85c75cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);
} }