I'm using the library react-google-recaptcha-v3 in order to integrate reCAPTCHA v3 into my React application, which also uses Next.
There's the following example in the README introducing users to the useGoogleReCaptcha
hook:
import {
GoogleReCaptchaProvider,
useGoogleReCaptcha
} from 'react-google-recaptcha-v3';
const YourReCaptchaComponent = () => {
const { executeRecaptcha } = useGoogleReCaptcha();
const token = executeRecaptcha("login_page");
return (...)
}
ReactDom.render(
<GoogleReCaptchaProvider reCaptchaKey="[Your recaptcha key]">
<YourReCaptchaComponent />
</GoogleReCaptchaProvider>,
document.getElementById('app')
);
I'm confused how I am supposed to use const token = executeRecaptcha("login_page")
. I don't currently understand how developers should use this token
. Isn't there a "score" associated with this token, whereby potential bots will be disallowed from using the page?
How do I verify this token and work with it? Any help appreciated.