fix: 🍪 packages confusion (#16735)

fix: cookie packages confusion
This commit is contained in:
Daniel Dietzler 2025-03-10 03:03:10 +01:00 committed by GitHub
parent 2aac679185
commit 573d9a7733
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 19 deletions

View file

@ -1,6 +1,6 @@
import { BadRequestException, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common';
import { isString } from 'class-validator';
import cookieParser from 'cookie';
import { parse } from 'cookie';
import { DateTime } from 'luxon';
import { IncomingHttpHeaders } from 'node:http';
import { LOGIN_URL, MOBILE_REDIRECT, SALT_ROUNDS } from 'src/constants';
@ -287,7 +287,7 @@ export class AuthService extends BaseService {
}
private getCookieToken(headers: IncomingHttpHeaders): string | null {
const cookies = cookieParser.parse(headers.cookie || '');
const cookies = parse(headers.cookie || '');
return cookies[ImmichCookie.ACCESS_TOKEN] || null;
}