From ef64911e4595941e837dea3637be2a7d925cfd45 Mon Sep 17 00:00:00 2001 From: Piyush Yadav <72244570+piyushyadav1617@users.noreply.github.com> Date: Mon, 27 May 2024 21:36:34 +0530 Subject: [PATCH] fix: Requests for new captcha token after a wrong password is entered. (#5614) Fix issue where captcha did not reset after an incorrect password was entered and invalid token error was thrown, ensuring users receive a new captcha token on each attempt. before: ![Screenshot 2024-05-27 191707](https://github.com/twentyhq/twenty/assets/72244570/7530c569-a3b5-46b9-96aa-b03c21f1e99a) after: user can try again with a new captcha token and login smoothly without encountering the invalid token error. --- .../src/modules/auth/sign-in-up/hooks/useSignInUp.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.tsx index ba8ddd471..24111466a 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.tsx @@ -118,6 +118,7 @@ export const useSignInUp = (form: UseFormReturn
) => { enqueueSnackBar(err?.message, { variant: SnackBarVariant.Error, }); + requestFreshCaptchaToken(); } }, [ @@ -128,6 +129,7 @@ export const useSignInUp = (form: UseFormReturn) => { signUpWithCredentials, workspaceInviteHash, enqueueSnackBar, + requestFreshCaptchaToken, ], );