2025-08-21 15:24:40 +09:00
|
|
|
import { IsEmail, IsString, MinLength, Matches } from "class-validator";
|
|
|
|
|
import { ApiProperty } from "@nestjs/swagger";
|
2025-08-20 18:02:50 +09:00
|
|
|
|
|
|
|
|
export class SetPasswordDto {
|
2025-08-21 15:24:40 +09:00
|
|
|
@ApiProperty({ example: "user@example.com" })
|
2025-08-20 18:02:50 +09:00
|
|
|
@IsEmail()
|
|
|
|
|
email: string;
|
|
|
|
|
|
2025-08-21 15:24:40 +09:00
|
|
|
@ApiProperty({
|
|
|
|
|
example: "NewSecurePassword123!",
|
|
|
|
|
description:
|
|
|
|
|
"Password must be at least 8 characters and contain uppercase, lowercase, number, and special character",
|
2025-08-20 18:02:50 +09:00
|
|
|
})
|
|
|
|
|
@IsString()
|
2025-08-21 15:24:40 +09:00
|
|
|
@MinLength(8, { message: "Password must be at least 8 characters long" })
|
2025-09-02 13:52:13 +09:00
|
|
|
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]*$/, {
|
2025-08-21 15:24:40 +09:00
|
|
|
message:
|
|
|
|
|
"Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character",
|
|
|
|
|
})
|
2025-08-20 18:02:50 +09:00
|
|
|
password: string;
|
|
|
|
|
}
|