refactor(server): narrow auth types (#16066)

This commit is contained in:
Jason Rasmussen 2025-02-12 15:23:08 -05:00 committed by GitHub
parent 7c821dd205
commit 2d7c333c8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 265 additions and 239 deletions

View file

@ -1,11 +1,9 @@
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsEmail, IsNotEmpty, IsString, MinLength } from 'class-validator';
import { SessionEntity } from 'src/entities/session.entity';
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
import { AuthApiKey, AuthSession, AuthSharedLink, AuthUser } from 'src/database';
import { UserEntity } from 'src/entities/user.entity';
import { ImmichCookie } from 'src/enum';
import { AuthApiKey } from 'src/types';
import { toEmail } from 'src/validation';
export type CookieResponse = {
@ -14,11 +12,11 @@ export type CookieResponse = {
};
export class AuthDto {
user!: UserEntity;
user!: AuthUser;
apiKey?: AuthApiKey;
sharedLink?: SharedLinkEntity;
session?: SessionEntity;
sharedLink?: AuthSharedLink;
session?: AuthSession;
}
export class LoginCredentialDto {