Some jellyseerr clients dont set cookies

This commit is contained in:
herrrta
2024-12-30 09:12:00 -05:00
parent 001eba02b4
commit cf58a5e749

View File

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