mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-11 15:48:09 +00:00
add forget password validator
This commit is contained in:
@ -1,14 +1,25 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
||||||
|
import { IsPasswordStrong } from 'src/validators/password.validator';
|
||||||
|
|
||||||
export class ForgetPasswordDto {
|
export class ForgetPasswordDto {
|
||||||
@ApiProperty()
|
@ApiProperty({
|
||||||
|
description: 'email',
|
||||||
|
required: true,
|
||||||
|
})
|
||||||
@IsEmail()
|
@IsEmail()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
email: string;
|
public email: string;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty({
|
||||||
|
description: 'password',
|
||||||
|
required: true,
|
||||||
|
})
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
password: string;
|
@IsPasswordStrong({
|
||||||
|
message:
|
||||||
|
'password must be at least 8 characters long and include at least one uppercase letter, one lowercase letter, one numeric digit, and one special character.',
|
||||||
|
})
|
||||||
|
public password: string;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user