mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): cookies (#8920)
This commit is contained in:
parent
eaf9e5e477
commit
74c921148b
12 changed files with 158 additions and 155 deletions
|
|
@ -10,7 +10,6 @@ import {
|
|||
import { Reflector } from '@nestjs/core';
|
||||
import { ApiBearerAuth, ApiCookieAuth, ApiOkResponse, ApiQuery, ApiSecurity } from '@nestjs/swagger';
|
||||
import { Request } from 'express';
|
||||
import { IMMICH_API_KEY_NAME } from 'src/constants';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { AuthService, LoginDetails } from 'src/services/auth.service';
|
||||
|
|
@ -21,6 +20,7 @@ export enum Metadata {
|
|||
ADMIN_ROUTE = 'admin_route',
|
||||
SHARED_ROUTE = 'shared_route',
|
||||
PUBLIC_SECURITY = 'public_security',
|
||||
API_KEY_SECURITY = 'api_key',
|
||||
}
|
||||
|
||||
export interface AuthenticatedOptions {
|
||||
|
|
@ -32,7 +32,7 @@ export const Authenticated = (options: AuthenticatedOptions = {}) => {
|
|||
const decorators: MethodDecorator[] = [
|
||||
ApiBearerAuth(),
|
||||
ApiCookieAuth(),
|
||||
ApiSecurity(IMMICH_API_KEY_NAME),
|
||||
ApiSecurity(Metadata.API_KEY_SECURITY),
|
||||
SetMetadata(Metadata.AUTH_ROUTE, true),
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue