Co-authored-by: Julien Martin <julien.martin@ptits-pas.fr> Co-committed-by: Julien Martin <julien.martin@ptits-pas.fr>
This commit was merged in pull request #77.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user