File

src/auth/dtos/auth-change-password-user.dto.ts

Index

Properties

Properties

currentPassword
Type : string
Decorators :
@ApiProperty({type: 'string', required: true})
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$&+,:;=?@#|'<>.^*()%!-])[^\s]{8,}$/, {message: 'invalid password'})
email
Type : string
Decorators :
@ApiProperty({type: 'string', required: true})
@IsEmail()
mfaCode
Type : string
Decorators :
@ApiProperty({type: 'string', required: true})
@IsString()
@IsOptional()
newPassword
Type : string
Decorators :
@ApiProperty({type: 'string', required: true})
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$&+,:;=?@#|'<>.^*()%!-])[^\s]{8,}$/, {message: 'invalid password'})
session
Type : string
Decorators :
@ApiProperty({type: 'string', required: true})
@IsString()
@IsOptional()
import { ApiProperty } from "@nestjs/swagger";
import { IsEmail, IsOptional, IsString, Matches } from "class-validator";

export class AuthChangePasswordUserDto {
  @ApiProperty({
    type: "string",
    required: true,
  })
  @IsEmail()
  email: string;

  /* Minimum eight characters, at least one uppercase letter, one lowercase letter, one number, and one special character */

  @ApiProperty({
    type: "string",
    required: true,
  })
  @Matches(
    /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$&+,:;=?@#|'<>.^*()%!-])[^\s]{8,}$/,
    { message: "invalid password" },
  )
  currentPassword: string;

  @ApiProperty({
    type: "string",
    required: true,
  })
  @Matches(
    /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$&+,:;=?@#|'<>.^*()%!-])[^\s]{8,}$/,
    { message: "invalid password" },
  )
  newPassword: string;

  @ApiProperty({
    type: "string",
    required: true,
  })
  @IsString()
  @IsOptional()
  mfaCode: string;

  @ApiProperty({
    type: "string",
    required: true,
  })
  @IsString()
  @IsOptional()
  session: string;
}

results matching ""

    No results matching ""