Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
How do I validate user in reCAPTCHA v3 in react.js?

I am using the library "react-google-recaptcha-v3" for reCAPTCHA in React.

I have a SignUp component, which essentially is something along the lines of a form where users can add their credentials and then create an account.

The function looks like this:


const SignUp = () => {
...

  const { executeRecaptcha } = useGoogleReCaptcha();
  const handleReCaptchaVerify = useCallback(async () => {
    if (!executeRecaptcha) {
      console.log("Execute recaptcha not yet available");
      return;
    }

    const token = await executeRecaptcha();
    console.log(token);
  });
...

  return (
...
        <div
          onClick={() => {
            handleReCaptchaVerify().then(() => {
              createUserEmailPassword(email, password, username);
            });
          }}
          className="auth-sign-button"
        >
          Create a new account
        </div>
...
  );
};

As you can see the function handleReCaptchaVerify() is being called once the user tries to create a new account. This function provides me with a token, as the SignUp component is later rendered from within a component.

How do I, validate the user once I receive the token, from the handleReCaptchaVerify() function?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!