fix(auth): remove unnecessary captcha token validation (#3188)
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.
This commit is contained in:
parent
cc704f1bc3
commit
0724cf05f0
2 changed files with 1 additions and 3 deletions
|
|
@ -32,7 +32,7 @@ function CreatePassword(props: Props & WithCaptchaProps) {
|
||||||
const { submitWithCaptcha, isVerifyingCaptcha, resetCaptcha } = props;
|
const { submitWithCaptcha, isVerifyingCaptcha, resetCaptcha } = props;
|
||||||
|
|
||||||
const handleSubmit = (token?: string) => {
|
const handleSubmit = (token?: string) => {
|
||||||
if (!validatePassword(password) || !token) {
|
if (!validatePassword(password)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,6 @@ function ResetPasswordRequest(props: Props & WithCaptchaProps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmit = (token?: string) => {
|
const handleSubmit = (token?: string) => {
|
||||||
if (!token) return;
|
|
||||||
|
|
||||||
setError(null);
|
setError(null);
|
||||||
requestResetPassword({ email: email.trim(), 'g-recaptcha-response': token })
|
requestResetPassword({ email: email.trim(), 'g-recaptcha-response': token })
|
||||||
.catch((err: any) => {
|
.catch((err: any) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue