diff --git a/pkg/wsapi/api.go b/pkg/wsapi/api.go index f07cf39..50593c3 100644 --- a/pkg/wsapi/api.go +++ b/pkg/wsapi/api.go @@ -104,7 +104,7 @@ func (ws *wsSession) Go(ctx context.Context) error { } err = authP.handleMsg(ctx, rdr) - if err != nil { + if err != nil || ws.refreshToken == nil { return err } @@ -158,7 +158,7 @@ func (ws *wsSession) Go(ctx context.Context) error { log.Error().Err(err).Msg("handleMsg") } case <-ctx.Done(): - close(msgChan) + close(msgChan) // maybe remove this? return nil case m := <-write: err := ws.conn.WriteJSON(m)