1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00: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

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.