mirror of
https://github.com/quexten/goldwarden.git
synced 2024-12-18 16:11:31 +03:00
Fix idle websocket connection on logout
This commit is contained in:
parent
cc091ad488
commit
000f9e515d
@ -94,6 +94,16 @@ func connectToWebsocket(ctx context.Context, vault *vault.Vault, cfg *config.Con
|
||||
//handshake required for official bitwarden implementation
|
||||
c.WriteMessage(1, []byte(`{"protocol":"messagepack","version":1}`))
|
||||
|
||||
go func() {
|
||||
for {
|
||||
time.Sleep(5 * time.Second)
|
||||
if vault.Keyring.IsLocked() || cfg.IsLocked() || !cfg.IsLoggedIn() {
|
||||
c.Close()
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
defer close(done)
|
||||
for {
|
||||
|
Loading…
Reference in New Issue
Block a user