mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
408fa45c51
It's perfectly valid to have an email address without a TLD, for instance: - test@localhost - test@svc-in-same-k8s-namespace - test@internal-corp Fixes #2667
25 lines
608 B
TypeScript
25 lines
608 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
|
|
|
export class SignUpDto {
|
|
@IsEmail({ require_tld: false })
|
|
@ApiProperty({ example: 'testuser@email.com' })
|
|
@Transform(({ value }) => value.toLowerCase())
|
|
email!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@ApiProperty({ example: 'password' })
|
|
password!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@ApiProperty({ example: 'Admin' })
|
|
firstName!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@ApiProperty({ example: 'Doe' })
|
|
lastName!: string;
|
|
}
|