diff --git a/bundles/org.openhab.ui/web/src/js/openhab/ws.js b/bundles/org.openhab.ui/web/src/js/openhab/ws.js index 323092138..a39d5e3c0 100644 --- a/bundles/org.openhab.ui/web/src/js/openhab/ws.js +++ b/bundles/org.openhab.ui/web/src/js/openhab/ws.js @@ -10,8 +10,9 @@ const HEARTBEAT_MESSAGE = `{ const openWSConnections = [] function newWSConnection (path, messageCallback, readyCallback, errorCallback, heartbeatCallback, heartbeatInterval) { + const encodedToken = btoa(getAccessToken()).replace(/=*$/, '') // Create a new WebSocket connection - const socket = new WebSocket(path, [`org.openhab.ws.accessToken.base64.${btoa(getAccessToken())}`, 'org.openhab.ws.protocol.default']) + const socket = new WebSocket(path, [`org.openhab.ws.accessToken.base64.${encodedToken}`, 'org.openhab.ws.protocol.default']) // Handle WebSocket connection opened socket.onopen = (event) => {