File

src/auth/dto/resetpass.dto.ts

Index

Properties

Properties

Public email
Type : string
Decorators :
@IsEmail()
@IsString()
@IsNotEmpty()
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;
}

results matching ""

    No results matching ""