diff --git a/action_cable_react_jwt.js b/action_cable_react_jwt.js index fe37797..6a13ded 100644 --- a/action_cable_react_jwt.js +++ b/action_cable_react_jwt.js @@ -241,7 +241,7 @@ if (this.webSocket != null) { this.uninstallEventHandlers(); } - this.webSocket = new WebSocket(this.consumer.url, protocols.concat(this.consumer.jwt)); + this.webSocket = new WebSocket(this.consumer.url, this.consumer.jwt ? protocols.concat(this.consumer.jwt) : protocols); this.webSocket.protocol = 'actioncable-v1-json'; this.installEventHandlers(); this.monitor.start();