Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda