Sending validation errors to totp

This commit is contained in:
Maxime Lalo 2023-11-29 16:52:38 +01:00
parent 7e7725c8ff
commit e9e454cfc3
2 changed files with 9 additions and 1 deletions

View File

@ -56,8 +56,8 @@ export default function StepTotp(props: IProps) {
<Button <Button
variant={EButtonVariant.LINE} variant={EButtonVariant.LINE}
disabled={disableNewCodeButton} disabled={disableNewCodeButton}
onClick={sendAnotherCode}
data-disabled={disableNewCodeButton.toString()} data-disabled={disableNewCodeButton.toString()}
onClick={sendAnotherCode}
className={classes["new-code-button"]}> className={classes["new-code-button"]}>
Envoyer un nouveau code Envoyer un nouveau code
</Button> </Button>

View File

@ -181,6 +181,14 @@ export default function Login() {
try { try {
await Auth.getInstance().sendAnotherCode({ email }); await Auth.getInstance().sendAnotherCode({ email });
} catch (error: any) { } catch (error: any) {
setValidationErrors([
{
property: "totpCode",
constraints: {
[error.http_status]: error.message,
},
},
]);
return; return;
} }
}, [email]); }, [email]);