mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
allow emails without a tld (#2762)
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
This commit is contained in:
@@ -3,7 +3,7 @@ import { IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import { toEmail, toSanitized } from '@app/immich/utils/transform.util';
|
||||
|
||||
export class CreateUserDto {
|
||||
@IsEmail()
|
||||
@IsEmail({ require_tld: false })
|
||||
@Transform(toEmail)
|
||||
email!: string;
|
||||
|
||||
@@ -29,7 +29,7 @@ export class CreateAdminDto {
|
||||
@IsNotEmpty()
|
||||
isAdmin!: true;
|
||||
|
||||
@IsEmail()
|
||||
@IsEmail({ require_tld: false })
|
||||
@Transform(({ value }) => value?.toLowerCase())
|
||||
email!: string;
|
||||
|
||||
@@ -44,7 +44,7 @@ export class CreateAdminDto {
|
||||
}
|
||||
|
||||
export class CreateUserOAuthDto {
|
||||
@IsEmail()
|
||||
@IsEmail({ require_tld: false })
|
||||
@Transform(({ value }) => value?.toLowerCase())
|
||||
email!: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user