src/auth/dto/resetpass.dto.ts
Properties |
|
| Public email |
Type : string
|
Decorators :
@IsEmail()
|
|
Defined in src/auth/dto/resetpass.dto.ts:16
|
import {
IsEmail,
IsNotEmpty,
IsString,
MaxLength,
MinLength,
} from 'class-validator';
import { IsCodeValid } from '../../common/decorators/codevaild.decorator';
import { IsCodeExpired } from '../../common/decorators/codeexpired.decorator';
import { RegisterRespEnum } from '../../utils/enums/responses/register.enum';
export class InitResetPassDto {
@IsEmail()
@IsString()
@IsNotEmpty()
public email: string;
}
export class ResetPassDto {
@IsCodeValid()
@IsCodeExpired()
@IsNotEmpty()
public code: string;
@MinLength(8, {
message: RegisterRespEnum.ERR_PASSWORD_TOOSHORT,
})
@MaxLength(128, {
message: RegisterRespEnum.ERR_PASSWORD_TOOLONG,
})
@IsNotEmpty({
message: RegisterRespEnum.ERR_PASSWORD_INVALID,
})
public password: string;
}