Feat: Cookie authentication #130

Merged
KevinMidboe merged 21 commits from feat/cookie-authentication into master 2022-08-15 21:59:12 +00:00
Showing only changes of commit a3543090f2 - Show all commits

View File

@@ -10,6 +10,12 @@ const redisCache = new RedisCache();
const sanitize = string => string.toLowerCase().replace(/[^\w]/gi, "");
function fixedEncodeURIComponent(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
});
}
const matchingTitleAndYear = (plex, tmdb) => {
let matchingTitle, matchingYear;
@@ -152,7 +158,7 @@ class Plex {
)
return false;
const keyUriComponent = encodeURIComponent(matchingObjectInPlex.key);
const keyUriComponent = fixedEncodeURIComponent(matchingObjectInPlex.key);
return `https://app.plex.tv/desktop#!/server/${machineIdentifier}/details?key=${keyUriComponent}`;
});
}
@@ -162,7 +168,7 @@ class Plex {
const url = `http://${this.plexIP}:${
this.plexPort
}/hubs/search?query=${encodeURIComponent(query)}`;
}/hubs/search?query=${fixedEncodeURIComponent(query)}`;
const options = {
timeout: 20000,
headers: { Accept: "application/json" }