-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REMANIEMENT][NAVIGATION PUBLIQUE] Masque le menu sur les pages du pa…
…rcours Mot de passe oublié [REMANIEMENT] Enleve du inline style pour centrer des textes et utilise une classe CSS [REMANIEMENT] Rajoute la propriété alt sur une illustration [REMANIEMENT][FORMULAIRE MOT DE PASSE OUBLIE] Affiche dans le message de succès l'email renseigné dans le formulaire [REMANIEMENT][FORMULAIRE MOT DE PASSE OUBLIE] Navigue via react-router vers la racine [REMANIEMENT] Renomme des variables prev en precedent [REMANIEMENT] Echappe les caractères spéciaux dans le formulaire réinitialiser mot de passe [REMANIEMENT] Trime le token lors de la vérification si il existe ou non
- Loading branch information
Showing
12 changed files
with
100 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import { | |
} from './reducteurFormulaireMotDePasseOublie.ts'; | ||
import { Toast } from '../../../../composants/communs/Toasts/Toast.tsx'; | ||
import { constructeurParametresAPI } from '../../../../fournisseurs/api/ConstructeurParametresAPI.ts'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
export type CorpsMotDePasseOublie = { | ||
email: string; | ||
|
@@ -25,32 +26,33 @@ export const FormulaireMotDePasseOublieConnecte = () => { | |
'reinitialisation-mot-de-passe:reinitialisation-mot-de-passe' | ||
); | ||
|
||
const { mutate, isSuccess, error, isError, isPending } = useMutation({ | ||
mutationKey: ['reinitialisation-mot-de-passe'], | ||
mutationFn: (email: string) => { | ||
if (!email) Promise.reject('Aucun email renseigné !'); | ||
const { mutate, isSuccess, error, isError, isPending, variables } = | ||
useMutation({ | ||
mutationKey: ['reinitialisation-mot-de-passe'], | ||
mutationFn: (email: string) => { | ||
if (!email) Promise.reject('Aucun email renseigné !'); | ||
|
||
const actionSoumettre = new MoteurDeLiens( | ||
navigationMAC.etat | ||
).trouveEtRenvoie('reinitialisation-mot-de-passe'); | ||
const actionSoumettre = new MoteurDeLiens( | ||
navigationMAC.etat | ||
).trouveEtRenvoie('reinitialisation-mot-de-passe'); | ||
|
||
if (!actionSoumettre) | ||
throw new Error( | ||
'Une erreur est survenue lors de la demande de réinitialisation de mot de passe' | ||
); | ||
if (!actionSoumettre) | ||
throw new Error( | ||
'Une erreur est survenue lors de la demande de réinitialisation de mot de passe' | ||
); | ||
|
||
return macAPI.execute<void, void, CorpsMotDePasseOublie>( | ||
constructeurParametresAPI<CorpsMotDePasseOublie>() | ||
.url(actionSoumettre.url) | ||
.methode(actionSoumettre.methode!) | ||
.corps({ | ||
email: email, | ||
}) | ||
.construis(), | ||
(corps) => corps | ||
); | ||
}, | ||
}); | ||
return macAPI.execute<void, void, CorpsMotDePasseOublie>( | ||
constructeurParametresAPI<CorpsMotDePasseOublie>() | ||
.url(actionSoumettre.url) | ||
.methode(actionSoumettre.methode!) | ||
.corps({ | ||
email: email, | ||
}) | ||
.construis(), | ||
(corps) => corps | ||
); | ||
}, | ||
}); | ||
|
||
if (isPending) | ||
return ( | ||
|
@@ -70,7 +72,7 @@ export const FormulaireMotDePasseOublieConnecte = () => { | |
<i className="mac-icone-information" /> | ||
<div> | ||
Si le compte existe, un e-mail de redéfinition de mot de passe sera | ||
envoyé à : <b>[email protected]</b> Veuillez vérifier votre boîte de | ||
envoyé à : <b>{variables}</b>. Veuillez vérifier votre boîte de | ||
réception. | ||
</div> | ||
</div> | ||
|
@@ -84,6 +86,8 @@ export const FormulaireMotDePasseOublie = ({ | |
}: { | ||
surSoumission: (email: string) => void; | ||
}) => { | ||
const navigate = useNavigate(); | ||
|
||
const [etatFormulaire, declencheActionFormulaire] = useReducer( | ||
reducteurFormulaireMotDePasseOublie, | ||
initialiseFormulaireMotDePasseOublie() | ||
|
@@ -95,7 +99,7 @@ export const FormulaireMotDePasseOublie = ({ | |
|
||
return ( | ||
<div className="formulaire-mot-de-passe-oublie-layout"> | ||
<p style={{ textAlign: 'center' }}> | ||
<p className="text-center"> | ||
Pour réinitialiser votre mot de passe, veuillez spécifier l’adresse | ||
email que vous avez utilisée pour vous inscrire. | ||
</p> | ||
|
@@ -146,7 +150,7 @@ export const FormulaireMotDePasseOublie = ({ | |
<Button | ||
type="button" | ||
variant="secondary" | ||
onClick={() => window.location.replace('/')} | ||
onClick={() => navigate('/')} | ||
> | ||
Annuler | ||
</Button> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters