mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
connect to socket with access token
This commit is contained in:
parent
a97701541a
commit
5fd8da389b
@ -337,7 +337,12 @@
|
||||
|
||||
self.openWebSocket = function () {
|
||||
|
||||
if (!accessToken) {
|
||||
throw new Error("Cannot open web socket without access token.");
|
||||
}
|
||||
|
||||
var url = serverAddress.replace('http', 'ws');
|
||||
url += "?api_key=" + accessToken;
|
||||
|
||||
webSocket = new WebSocket(url);
|
||||
|
||||
@ -351,12 +356,8 @@
|
||||
|
||||
logger.log('web socket connection opened');
|
||||
setTimeout(function () {
|
||||
|
||||
self.sendWebSocketMessage("Identity", clientName + "|" + deviceId + "|" + applicationVersion + "|" + deviceName);
|
||||
|
||||
Events.trigger(self, 'websocketopen');
|
||||
|
||||
}, 500);
|
||||
}, 0);
|
||||
};
|
||||
webSocket.onerror = function () {
|
||||
setTimeout(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user