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
variant={EButtonVariant.LINE}
disabled={disableNewCodeButton}
onClick={sendAnotherCode}
data-disabled={disableNewCodeButton.toString()}
onClick={sendAnotherCode}
className={classes["new-code-button"]}>
Envoyer un nouveau code
</Button>

View File

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