Co-authored-by: Julien Martin <julien.martin@ptits-pas.fr> Co-committed-by: Julien Martin <julien.martin@ptits-pas.fr>
24 lines
800 B
TypeScript
24 lines
800 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsString, MinLength, Matches } from 'class-validator';
|
|
|
|
export class ChangePasswordRequiredDto {
|
|
@ApiProperty({ description: 'Mot de passe actuel' })
|
|
@IsString()
|
|
mot_de_passe_actuel: string;
|
|
|
|
@ApiProperty({
|
|
description: 'Nouveau mot de passe (min 8 caractères, 1 majuscule, 1 chiffre)',
|
|
minLength: 8
|
|
})
|
|
@IsString()
|
|
@MinLength(8, { message: 'Le mot de passe doit contenir au moins 8 caractères' })
|
|
@Matches(/^(?=.*[A-Z])(?=.*\d)/, {
|
|
message: 'Le mot de passe doit contenir au moins une majuscule et un chiffre'
|
|
})
|
|
nouveau_mot_de_passe: string;
|
|
|
|
@ApiProperty({ description: 'Confirmation du nouveau mot de passe' })
|
|
@IsString()
|
|
confirmation_mot_de_passe: string;
|
|
}
|