From 6adb45e15f748333ac6d3bdfe99247671fc4937d Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 21 Mar 2025 10:54:07 +0100 Subject: [PATCH] fix(auth): remove unnecessary captcha token validation The token validation checks were redundant as the validation is already handled by the captcha wrapper component. This change simplifies the password reset flow while maintaining security. --- frontend/app/components/ForgotPassword/CreatePassword.tsx | 2 +- frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/app/components/ForgotPassword/CreatePassword.tsx b/frontend/app/components/ForgotPassword/CreatePassword.tsx index be3571a0f..2c8706ade 100644 --- a/frontend/app/components/ForgotPassword/CreatePassword.tsx +++ b/frontend/app/components/ForgotPassword/CreatePassword.tsx @@ -32,7 +32,7 @@ function CreatePassword(props: Props & WithCaptchaProps) { const { submitWithCaptcha, isVerifyingCaptcha, resetCaptcha } = props; const handleSubmit = (token?: string) => { - if (!validatePassword(password) || !token) { + if (!validatePassword(password)) { return; } diff --git a/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx b/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx index 59210ef53..73099f31b 100644 --- a/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx +++ b/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx @@ -43,8 +43,6 @@ function ResetPasswordRequest(props: Props & WithCaptchaProps) { }; const handleSubmit = (token?: string) => { - if (!token) return; - setError(null); requestResetPassword({ email: email.trim(), 'g-recaptcha-response': token }) .catch((err: any) => {