fix(deps): update dependency cookie to v2 (#31916)

Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
(cherry picked from commit e505e5113b43177ad215d075dca25dc056dd1a40)
This commit is contained in:
renovate[bot]
2026-10-22 05:23:59 +03:00
committed by Codex
parent 630240971f
commit 235e57bf77
4 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -71,7 +71,7 @@
"bullmq": "^6.0.0",
"chokidar": "^5.0.0",
"compression": "^1.8.0",
"cookie": "^1.0.2",
"cookie": "^2.0.0",
"cookie-parser": "^1.4.7",
"cron": "4.4.0",
"exiftool-vendored": "^35.20.0",
@@ -1,5 +1,5 @@
import { Injectable, UnauthorizedException } from '@nestjs/common';
import { parse } from 'cookie';
import { parseCookie } from 'cookie';
import { NextFunction, Request, Response } from 'express';
import { jwtVerify } from 'jose';
import { readFileSync } from 'node:fs';
@@ -240,7 +240,7 @@ export class MaintenanceWorkerService {
}
async authenticate(headers: IncomingHttpHeaders): Promise<MaintenanceAuthDto> {
const jwtToken = parse(headers.cookie || '')[ImmichCookie.MaintenanceToken];
const jwtToken = parseCookie(headers.cookie || '')[ImmichCookie.MaintenanceToken];
return this.login(jwtToken);
}
+4 -4
View File
@@ -1,5 +1,5 @@
import { BadRequestException, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common';
import { parse } from 'cookie';
import { parseCookie } from 'cookie';
import { DateTime } from 'luxon';
import { IncomingHttpHeaders } from 'node:http';
import sanitize from 'sanitize-filename';
@@ -482,17 +482,17 @@ export class AuthService extends BaseService {
}
private getCookieToken(headers: IncomingHttpHeaders): string | null {
const cookies = parse(headers.cookie || '');
const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.AccessToken] || null;
}
private getCookieOauthState(headers: IncomingHttpHeaders): string | null {
const cookies = parse(headers.cookie || '');
const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.OAuthState] || null;
}
private getCookieCodeVerifier(headers: IncomingHttpHeaders): string | null {
const cookies = parse(headers.cookie || '');
const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.OAuthCodeVerifier] || null;
}