From 55a31a507c1866451f4e3e323137ae308ba3dcce Mon Sep 17 00:00:00 2001 From: pestak Date: Tue, 16 Dec 2025 08:50:31 +0100 Subject: [PATCH] =?UTF-8?q?integration=20de=20password.js=20=C3=A0=20reini?= =?UTF-8?q?tialisation=20mdp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../html/reinitialisation_mot_de_passe.html | 155 ++++++++---------- .../js/reinitialisation_du_mot_de_passe.js | 4 +- js/password.js | 9 +- 3 files changed, 76 insertions(+), 92 deletions(-) diff --git a/connexion/html/reinitialisation_mot_de_passe.html b/connexion/html/reinitialisation_mot_de_passe.html index 815bf40..65e5be2 100644 --- a/connexion/html/reinitialisation_mot_de_passe.html +++ b/connexion/html/reinitialisation_mot_de_passe.html @@ -1,100 +1,77 @@ - - - - Réinitialisation du mot de passe - - - - -
-
-

Nouveau mot de passe

-

- Pour réinitialiser votre mot de passe, veuillez saisir un nouveau mot - de passe ainsi qu'une confirmation. + + + + Réinitialisation du mot de passe + + + + + + + + +

+
+

Nouveau mot de passe

+

+ Pour réinitialiser votre mot de passe, veuillez saisir un nouveau mot + de passe ainsi qu'une confirmation. + +

+ + + +
+
+
+ + -

- - +
- -
- - - -
- -
- - -
- - - - + + + + +
+
- - - - + + + + + \ No newline at end of file diff --git a/connexion/js/reinitialisation_du_mot_de_passe.js b/connexion/js/reinitialisation_du_mot_de_passe.js index 800adda..bc534d1 100644 --- a/connexion/js/reinitialisation_du_mot_de_passe.js +++ b/connexion/js/reinitialisation_du_mot_de_passe.js @@ -40,7 +40,7 @@ form.addEventListener('submit', function(e) { if (pass.length < minLength) { errorMsg.style.display = 'block'; errorMsg.textContent = `Le mot de passe doit contenir au moins ${minLength} caractères.`; - return; + return;8 caractères minimum } //Correspondance @@ -61,7 +61,7 @@ form.addEventListener('submit', function(e) { showPasswordCheckbox.addEventListener('change', function() { - if (this.checked) { + if (this.checked) {8 caractères minimum password.type = 'text'; confirmPassword.type = 'text'; diff --git a/js/password.js b/js/password.js index f503852..397171a 100644 --- a/js/password.js +++ b/js/password.js @@ -81,10 +81,17 @@ passwordForm.addEventListener('submit', function(event) { password !== confirmPassword) { event.preventDefault(); + const main = document.querySelector('main'); + const existingAlert = main.querySelector('#password-alert'); + if (existingAlert) { + existingAlert.remove(); + } + const alertElt = document.createElement('div'); + alertElt.id = 'password-alert'; alertElt.className = 'alert alert-danger text-center'; alertElt.textContent = "Le mot de passe ne respecte pas les critères requis ou la confirmation ne correspond pas."; - document.querySelector('main').prepend(alertElt); + main.prepend(alertElt); window.scrollTo(0, 0);