mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update connect login
This commit is contained in:
parent
f7ba95439b
commit
a19bc334f3
2 changed files with 38 additions and 21 deletions
|
@ -731,13 +731,12 @@
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "https://connect.mediabrowser.tv/service/user/authenticate",
|
url: "https://connect.mediabrowser.tv/service/user/authenticate",
|
||||||
data: {
|
data: {
|
||||||
userName: username,
|
nameOrEmail: username,
|
||||||
password: md5
|
password: md5
|
||||||
},
|
},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
|
contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||||
|
|
||||||
|
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
|
|
||||||
var credentials = credentialProvider.credentials();
|
var credentials = credentialProvider.credentials();
|
||||||
|
@ -751,25 +750,9 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function replaceAll(str, find, replace) {
|
|
||||||
|
|
||||||
return str.split(find).join(replace);
|
|
||||||
|
|
||||||
//return str.replace(new RegExp(find, 'g'), replace);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.getConnectPasswordHash = function (password) {
|
self.getConnectPasswordHash = function (password) {
|
||||||
|
|
||||||
password = password || '';
|
password = globalScope.MediaBrowser.ConnectService.cleanPassword(password);
|
||||||
|
|
||||||
password = replaceAll(password, "&", "&");
|
|
||||||
password = replaceAll(password, "/", "\");
|
|
||||||
password = replaceAll(password, "!", "!");
|
|
||||||
password = replaceAll(password, "$", "$");
|
|
||||||
password = replaceAll(password, "\"", """);
|
|
||||||
password = replaceAll(password, "<", "<");
|
|
||||||
password = replaceAll(password, ">", ">");
|
|
||||||
password = replaceAll(password, "'", "'");
|
|
||||||
|
|
||||||
return CryptoJS.MD5(password).toString();
|
return CryptoJS.MD5(password).toString();
|
||||||
};
|
};
|
||||||
|
@ -820,9 +803,9 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.acceptServer = function (authorizationId) {
|
self.acceptServer = function (serverId) {
|
||||||
|
|
||||||
var url = "https://connect.mediabrowser.tv/service/ServerAuthorizations/accept?id=" + authorizationId;
|
var url = "https://connect.mediabrowser.tv/service/ServerAuthorizations/accept?serverId=" + serverId + "&userId=" + self.connectUserId();
|
||||||
|
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
|
34
dashboard-ui/thirdparty/apiclient/connectservice.js
vendored
Normal file
34
dashboard-ui/thirdparty/apiclient/connectservice.js
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
(function (globalScope) {
|
||||||
|
|
||||||
|
if (!globalScope.MediaBrowser) {
|
||||||
|
globalScope.MediaBrowser = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
function replaceAll(str, find, replace) {
|
||||||
|
|
||||||
|
return str.split(find).join(replace);
|
||||||
|
}
|
||||||
|
|
||||||
|
var connectService = {
|
||||||
|
|
||||||
|
cleanPassword: function (password) {
|
||||||
|
|
||||||
|
password = password || '';
|
||||||
|
|
||||||
|
password = replaceAll(password, "&", "&");
|
||||||
|
password = replaceAll(password, "/", "\");
|
||||||
|
password = replaceAll(password, "!", "!");
|
||||||
|
password = replaceAll(password, "$", "$");
|
||||||
|
password = replaceAll(password, "\"", """);
|
||||||
|
password = replaceAll(password, "<", "<");
|
||||||
|
password = replaceAll(password, ">", ">");
|
||||||
|
password = replaceAll(password, "'", "'");
|
||||||
|
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
globalScope.MediaBrowser.ConnectService = connectService;
|
||||||
|
|
||||||
|
})(window);
|
Loading…
Add table
Add a link
Reference in a new issue