From b0594c32e74b28ed0e2c5d0185277ee42d599a95 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Thu, 16 Apr 2026 22:56:42 +0200 Subject: [PATCH] =?UTF-8?q?docs(tickets):=20#24=20livr=C3=A9=20backend,=20?= =?UTF-8?q?#43=20alignement=20API=20verify-token/create-password?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- docs/23_LISTE-TICKETS.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/23_LISTE-TICKETS.md b/docs/23_LISTE-TICKETS.md index 0d79a14..fdebf49 100644 --- a/docs/23_LISTE-TICKETS.md +++ b/docs/23_LISTE-TICKETS.md @@ -519,22 +519,24 @@ Finalisation de l'inscription parent (présentation, CGU, récapitulatif - inté --- -### Ticket #24 : [Backend] API Création mot de passe +### Ticket #24 : [Backend] API Création mot de passe ✅ **Estimation** : 3h -**Labels** : `backend`, `p2`, `auth`, `security` +**Labels** : `backend`, `p2`, `auth`, `security` +**Statut** : ✅ TERMINÉ (livré sur `develop` + `master`, févr. 2026 — aligné ticket Gitea **#123** durcissement token) **Description** : Créer les endpoints pour permettre aux utilisateurs de créer leur mot de passe via le lien reçu par email. **Tâches** : -- [ ] Endpoint `GET /api/v1/auth/verify-token?token=` -- [ ] Endpoint `POST /api/v1/auth/create-password` -- [ ] Validation token (existe, non expiré, non utilisé) -- [ ] Hash bcrypt + suppression token -- [ ] Activation compte (`statut = actif`) -- [ ] Tests unitaires +- [x] Endpoint `GET /api/v1/auth/verify-token?token=` +- [x] Endpoint `POST /api/v1/auth/create-password` (body : `token`, `password`, `password_confirmation`) +- [x] Validation token (existe, non expiré, non utilisé) + invalidation explicite si expiré +- [x] Hash bcrypt + suppression token (usage unique atomique côté SQL) +- [x] Activation compte (`statut = actif`, `changement_mdp_obligatoire = false`) +- [ ] Tests unitaires / e2e (hors périmètre immédiat ; suite Jest actuelle à corriger séparément) -**Référence** : [20_WORKFLOW-CREATION-COMPTE.md](./20_WORKFLOW-CREATION-COMPTE.md#étape-7--création-du-mot-de-passe) +**Référence** : [20_WORKFLOW-CREATION-COMPTE.md](./20_WORKFLOW-CREATION-COMPTE.md#étape-7--création-du-mot-de-passe) +**Suite** : alignement **frontend** → ticket **#43** (appels explicites ci-dessous). --- @@ -898,13 +900,15 @@ Créer les étapes finales de l'inscription AM (présentation, CGU, récapitulat **Description** : Créer l'écran de création de mot de passe (lien reçu par email). +**Dépendance backend** : ticket **#24** / **#123** — routes disponibles sous préfixe global `api/v1` (voir `backend/src/main.ts`). + **Tâches** : -- [ ] Page `/create-password?token=` -- [ ] Vérification token (appel API) +- [ ] Page `/create-password?token=` (lecture du `token` en query) +- [ ] Au chargement (ou avant affichage formulaire) : `GET /api/v1/auth/verify-token?token=` — si 404, message neutre type « lien invalide ou expiré » - [ ] Formulaire MDP + confirmation -- [ ] Validation côté client (8 car, 1 maj, 1 chiffre) -- [ ] Appel API création MDP -- [ ] Redirection vers login +- [ ] Validation côté client (alignée backend : min 8 car., 1 maj., 1 chiffre — même règle que `change-password-required`) +- [ ] Soumission : `POST /api/v1/auth/create-password` avec JSON `{ "token", "password", "password_confirmation" }` ; gérer 400 (ex. confirmation) / 404 (token) +- [ ] Succès → redirection vers login + message de succès ---