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
+6 -6
View File
@@ -653,8 +653,8 @@ importers:
specifier: ^1.8.0 specifier: ^1.8.0
version: 1.8.2(supports-color@8.1.1) version: 1.8.2(supports-color@8.1.1)
cookie: cookie:
specifier: ^1.0.2 specifier: ^2.0.0
version: 1.1.1 version: 2.0.1
cookie-parser: cookie-parser:
specifier: ^1.4.7 specifier: ^1.4.7
version: 1.4.7 version: 1.4.7
@@ -6778,9 +6778,9 @@ packages:
resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
cookie@1.1.1: cookie@2.0.1:
resolution: {integrity: sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==} resolution: {integrity: sha512-yuToqVvRrj6pfDXREyQAAv8SkAEk/8GS3jQRTiUMm66TVtBYmqQeoEjL2Lmq8Rpo6271vH76InTChTitEAm65w==}
engines: {node: '>=18'} engines: {node: '>=22'}
cookiejar@2.1.4: cookiejar@2.1.4:
resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==}
@@ -19791,7 +19791,7 @@ snapshots:
cookie@0.7.2: {} cookie@0.7.2: {}
cookie@1.1.1: {} cookie@2.0.1: {}
cookiejar@2.1.4: {} cookiejar@2.1.4: {}
+1 -1
View File
@@ -71,7 +71,7 @@
"bullmq": "^6.0.0", "bullmq": "^6.0.0",
"chokidar": "^5.0.0", "chokidar": "^5.0.0",
"compression": "^1.8.0", "compression": "^1.8.0",
"cookie": "^1.0.2", "cookie": "^2.0.0",
"cookie-parser": "^1.4.7", "cookie-parser": "^1.4.7",
"cron": "4.4.0", "cron": "4.4.0",
"exiftool-vendored": "^35.20.0", "exiftool-vendored": "^35.20.0",
@@ -1,5 +1,5 @@
import { Injectable, UnauthorizedException } from '@nestjs/common'; import { Injectable, UnauthorizedException } from '@nestjs/common';
import { parse } from 'cookie'; import { parseCookie } from 'cookie';
import { NextFunction, Request, Response } from 'express'; import { NextFunction, Request, Response } from 'express';
import { jwtVerify } from 'jose'; import { jwtVerify } from 'jose';
import { readFileSync } from 'node:fs'; import { readFileSync } from 'node:fs';
@@ -240,7 +240,7 @@ export class MaintenanceWorkerService {
} }
async authenticate(headers: IncomingHttpHeaders): Promise<MaintenanceAuthDto> { async authenticate(headers: IncomingHttpHeaders): Promise<MaintenanceAuthDto> {
const jwtToken = parse(headers.cookie || '')[ImmichCookie.MaintenanceToken]; const jwtToken = parseCookie(headers.cookie || '')[ImmichCookie.MaintenanceToken];
return this.login(jwtToken); return this.login(jwtToken);
} }
+4 -4
View File
@@ -1,5 +1,5 @@
import { BadRequestException, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common'; import { BadRequestException, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common';
import { parse } from 'cookie'; import { parseCookie } from 'cookie';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { IncomingHttpHeaders } from 'node:http'; import { IncomingHttpHeaders } from 'node:http';
import sanitize from 'sanitize-filename'; import sanitize from 'sanitize-filename';
@@ -482,17 +482,17 @@ export class AuthService extends BaseService {
} }
private getCookieToken(headers: IncomingHttpHeaders): string | null { private getCookieToken(headers: IncomingHttpHeaders): string | null {
const cookies = parse(headers.cookie || ''); const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.AccessToken] || null; return cookies[ImmichCookie.AccessToken] || null;
} }
private getCookieOauthState(headers: IncomingHttpHeaders): string | null { private getCookieOauthState(headers: IncomingHttpHeaders): string | null {
const cookies = parse(headers.cookie || ''); const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.OAuthState] || null; return cookies[ImmichCookie.OAuthState] || null;
} }
private getCookieCodeVerifier(headers: IncomingHttpHeaders): string | null { private getCookieCodeVerifier(headers: IncomingHttpHeaders): string | null {
const cookies = parse(headers.cookie || ''); const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.OAuthCodeVerifier] || null; return cookies[ImmichCookie.OAuthCodeVerifier] || null;
} }