High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
Fixed different lettercases in email create different user (#470)
Alex86f780871c47
diff --git a/server/apps/immich/src/api-v1/auth/auth.controller.ts b/server/apps/immich/src/api-v1/auth/auth.controller.tsindex ea7d68f3ea..031c39610d 100644--- a/server/apps/immich/src/api-v1/auth/auth.controller.ts+++ b/server/apps/immich/src/api-v1/auth/auth.controller.ts@@ -25,7 +25,7 @@ export class AuthController {@Post('/login')async login(- @Body(ValidationPipe) loginCredential: LoginCredentialDto,+ @Body(new ValidationPipe({ transform: true })) loginCredential: LoginCredentialDto,@Res() response: Response,): Promise<LoginResponseDto> {const loginResponse = await this.authService.login(loginCredential);@@ -42,7 +42,9 @@ export class AuthController {@Post('/admin-sign-up')@ApiBadRequestResponse({ description: 'The server already has an admin' })- async adminSignUp(@Body(ValidationPipe) signUpCredential: SignUpDto): Promise<AdminSignupResponseDto> {+ async adminSignUp(+ @Body(new ValidationPipe({ transform: true })) signUpCredential: SignUpDto,+ ): Promise<AdminSignupResponseDto> {return await this.authService.adminSignUp(signUpCredential);}@@ -61,8 +63,7 @@ export class AuthController {const status = new LogoutResponseDto(true);- response.send(status)+ response.send(status);return status;}-}diff --git a/server/apps/immich/src/api-v1/auth/dto/login-credential.dto.ts b/server/apps/immich/src/api-v1/auth/dto/login-credential.dto.tsindex 29ba5cf026..7426303528 100644--- a/server/apps/immich/src/api-v1/auth/dto/login-credential.dto.ts+++ b/server/apps/immich/src/api-v1/auth/dto/login-credential.dto.ts@@ -1,9 +1,11 @@import { ApiProperty } from '@nestjs/swagger';+import { Transform } from 'class-transformer';import { IsNotEmpty } from 'class-validator';export class LoginCredentialDto {@IsNotEmpty()@ApiProperty({ example: '[email protected]' })+ @Transform(({ value }) => value?.toLowerCase())email!: string;@IsNotEmpty()diff --git a/server/apps/immich/src/api-v1/auth/dto/sign-up.dto.ts b/server/apps/immich/src/api-v1/auth/dto/sign-up.dto.tsindex d8dbd8a8df..3358ddac31 100644--- a/server/apps/immich/src/api-v1/auth/dto/sign-up.dto.ts+++ b/server/apps/immich/src/api-v1/auth/dto/sign-up.dto.ts@@ -1,9 +1,11 @@import { ApiProperty } from '@nestjs/swagger';+import { Transform } from 'class-transformer';import { IsNotEmpty, IsEmail } from 'class-validator';export class SignUpDto {@IsEmail()@ApiProperty({ example: '[email protected]' })+ @Transform(({ value }) => value?.toLowerCase())email!: string;@IsNotEmpty()diff --git a/server/apps/immich/src/api-v1/user/dto/create-user.dto.ts b/server/apps/immich/src/api-v1/user/dto/create-user.dto.tsindex 13facfad34..d18f0a3237 100644--- a/server/apps/immich/src/api-v1/user/dto/create-user.dto.ts+++ b/server/apps/immich/src/api-v1/user/dto/create-user.dto.ts@@ -1,8 +1,10 @@import { ApiProperty } from '@nestjs/swagger';+import { Transform } from 'class-transformer';import { IsNotEmpty, IsEmail } from 'class-validator';export class CreateUserDto {@IsEmail()+ @Transform(({ value }) => value?.toLowerCase())@ApiProperty({ example: '[email protected]' })email!: string;diff --git a/server/apps/immich/src/api-v1/user/user.controller.ts b/server/apps/immich/src/api-v1/user/user.controller.tsindex 9e433c0076..e2eff4418c 100644--- a/server/apps/immich/src/api-v1/user/user.controller.ts+++ b/server/apps/immich/src/api-v1/user/user.controller.ts@@ -61,7 +61,9 @@ export class UserController {@ApiBearerAuth()@UseGuards(AdminRolesGuard)@Post()- async createUser(@Body(ValidationPipe) createUserDto: CreateUserDto): Promise<UserResponseDto> {+ async createUser(+ @Body(new ValidationPipe({ transform: true })) createUserDto: CreateUserDto,+ ): Promise<UserResponseDto> {return await this.userService.createUser(createUserDto);}