Reconnect websocket on unlock

This commit is contained in:
Bernd Schoolmann 2023-12-28 11:45:36 +01:00
parent faf66da833
commit 8263094c03
No known key found for this signature in database

View File

@ -182,9 +182,17 @@ func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
} }
}() }()
go func() {
if !runtimeConfig.WebsocketDisabled { if !runtimeConfig.WebsocketDisabled {
go bitwarden.RunWebsocketDaemon(ctx, vault, &cfg) for {
// polling, switch this to signal based later
if !cfg.IsLocked() && cfg.IsLoggedIn() {
bitwarden.RunWebsocketDaemon(ctx, vault, &cfg)
} }
time.Sleep(60 * time.Second)
}
}
}()
if !runtimeConfig.DisableSSHAgent { if !runtimeConfig.DisableSSHAgent {
vaultAgent := ssh.NewVaultAgent(vault, &cfg) vaultAgent := ssh.NewVaultAgent(vault, &cfg)