Merge pull request #320 from herrrta/fix/jellyseerr-cookies

Some jellyseerr clients dont set cookies
This commit is contained in:
Fredrik Burmester
2024-12-30 15:17:50 +01:00
committed by GitHub

View File

@@ -105,7 +105,7 @@ export class JellyseerrApi {
}
console.log("Jellyseerr connecting successfully tested!");
storage.setAny(JELLYSEERR_COOKIES, headers["set-cookie"]?.flatMap(c => c.split("; ")));
storage.setAny(JELLYSEERR_COOKIES, headers["set-cookie"]?.flatMap(c => c.split("; ")) ?? []);
return {
isValid: true,
requiresPass: true
@@ -243,7 +243,7 @@ export class JellyseerrApi {
this.axios.interceptors.request.use(
async (config) => {
const cookies = storage.get<string[]>(JELLYSEERR_COOKIES);
if (config.method !== "head" && cookies) {
if (cookies) {
const headerName = this.axios.defaults.xsrfHeaderName!!;
const xsrfToken = cookies
.find(c => c.includes(headerName))