Skip to content

Commit

Permalink
Reconnect websocket on unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Dec 28, 2023
1 parent faf66da commit 8263094
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions agent/unixsocketagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,17 @@ func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
}
}()

if !runtimeConfig.WebsocketDisabled {
go bitwarden.RunWebsocketDaemon(ctx, vault, &cfg)
}
go func() {
if !runtimeConfig.WebsocketDisabled {
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 {
vaultAgent := ssh.NewVaultAgent(vault, &cfg)
Expand Down

0 comments on commit 8263094

Please sign in to comment.