File

src/auth/dto/2fa.dto.ts

Index

Properties

Properties

code
Type : string
Decorators :
@IsNotEmpty()
@IsNumberString()
@MinLength(6)
@MaxLength(6)
password
Type : string
Decorators :
@IsNotEmpty()
@IsString()
import {
  IsNotEmpty,
  IsNumberString,
  IsString,
  MaxLength,
  MinLength,
} from 'class-validator';
import { IsCodeExpired } from '../../common/decorators/codeexpired.decorator';
import { IsCodeValid } from '../../common/decorators/codevaild.decorator';
import { IsCodeUsed } from '../../common/decorators/codeused.decorator';

export class TwoFactorEnableDto {
  @IsNotEmpty()
  @IsNumberString()
  @MinLength(6)
  @MaxLength(6)
  code: string;

  @IsNotEmpty()
  @IsString()
  password: string;
}

export class TwoFactorDisableDto {
  @IsNotEmpty()
  @IsString()
  password: string;
}

export class TwoFactorLoginDto {
  @IsNotEmpty()
  @IsNumberString()
  @MinLength(6)
  @MaxLength(6)
  token: string;

  @IsString()
  @IsNotEmpty()
  @IsCodeExpired()
  @IsCodeValid()
  @IsCodeUsed()
  code: string;
}

results matching ""

    No results matching ""