1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-30 22:41:33 +01:00

[PM-16918] Fix agent setting not disabling key usage (#12857)

* Fix agent setting not disabling key usage

* Cleanup

* Change firstvaluefrom to withlatestfrom

* Switch back to concatmap
This commit is contained in:
Bernd Schoolmann 2025-01-14 15:50:54 +01:00 committed by GitHub
parent b083a05d9f
commit 8717d79d51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,6 +83,15 @@ export class SshAgentService implements OnDestroy {
this.messageListener
.messages$(new CommandDefinition("sshagent.signrequest"))
.pipe(
withLatestFrom(this.desktopSettingsService.sshAgentEnabled$),
concatMap(async ([message, enabled]) => {
if (!enabled) {
await ipc.platform.sshAgent.signRequestResponse(message.requestId as number, false);
}
return { message, enabled };
}),
filter(({ enabled }) => enabled),
map(({ message }) => message),
withLatestFrom(this.authService.activeAccountStatus$),
// This switchMap handles unlocking the vault if it is locked:
// - If the vault is locked, we will wait for it to be unlocked.