Skip to content

Commit

Permalink
WS client: Remove trailing = from base64-encoded access token
Browse files Browse the repository at this point in the history
Follow-up for openhab#2907.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
  • Loading branch information
florian-h05 committed Jan 4, 2025
1 parent 6104cba commit 71b8cc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bundles/org.openhab.ui/web/src/js/openhab/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 71b8cc0

Please sign in to comment.