fix(auth): inscription AM — persister photo si photo_base64 sans photo_filename (#120)

- Défaut nom fichier photo_am.jpg ; extension finale dérivée du data-URL
- Swagger DTO + description endpoint register/am

Made-with: Cursor
This commit is contained in:
2026-04-12 21:37:47 +02:00
parent eac108c9f4
commit d69768806c
3 changed files with 13 additions and 4 deletions
+5 -2
View File
@@ -465,8 +465,11 @@ export class AuthService {
dateExpiration.setDate(dateExpiration.getDate() + joursExpirationToken);
let urlPhoto: string | null = null;
if (dto.photo_base64 && dto.photo_filename) {
urlPhoto = await this.sauvegarderPhotoDepuisBase64(dto.photo_base64, dto.photo_filename);
const photoB64 = (dto.photo_base64 ?? '').trim();
if (photoB64) {
const nomFichier =
(dto.photo_filename ?? '').trim() || 'photo_am.jpg';
urlPhoto = await this.sauvegarderPhotoDepuisBase64(photoB64, nomFichier);
}
const dateConsentementPhoto =