feat(auth): #127 forgot-password + reset-password API (BDD + mail)
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsOptional, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
/**
|
||||
* Ticket #127 — pas de @IsEmail / @MinLength stricts : éviter 400 sur saisies vides ou bizarres ;
|
||||
* le service renvoie toujours la même réponse 200 (anti-énumération).
|
||||
*/
|
||||
export class ForgotPasswordDto {
|
||||
@ApiProperty({
|
||||
example: 'parent@example.com',
|
||||
required: false,
|
||||
description: 'E-mail (trim + lowercase via transform). Absent ou vide → même réponse générique.',
|
||||
})
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(320)
|
||||
@Transform(({ value }) => (typeof value === 'string' ? value.trim().toLowerCase() : ''))
|
||||
email?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user