1
0
Fork 0
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:
Luke Pulverenti 2014-11-04 17:43:02 -05:00
parent f7ba95439b
commit a19bc334f3
2 changed files with 38 additions and 21 deletions

View file

@ -731,13 +731,12 @@
type: "POST",
url: "https://connect.mediabrowser.tv/service/user/authenticate",
data: {
userName: username,
nameOrEmail: username,
password: md5
},
dataType: "json",
contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
}).done(function (result) {
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) {
password = password || '';
password = replaceAll(password, "&", "&");
password = replaceAll(password, "/", "\");
password = replaceAll(password, "!", "!");
password = replaceAll(password, "$", "$");
password = replaceAll(password, "\"", """);
password = replaceAll(password, "<", "&lt;");
password = replaceAll(password, ">", "&gt;");
password = replaceAll(password, "'", "&#39;");
password = globalScope.MediaBrowser.ConnectService.cleanPassword(password);
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({
type: "GET",