contributte / reCAPTCHA

:bangbang: Google reCAPTCHA (security) for Nette Framework \ Forms
https://contributte.org/packages/contributte/reCAPTCHA.html
MIT License
41 stars 28 forks source link

Set minimal score for validation #64

Closed PavelWeirich closed 10 months ago

PavelWeirich commented 11 months ago

For better spam filtering, you can use the score returned by Google. The score is in range 0..1 (1.0 is very likely a good interaction, 0.0 is very likely a bot).

How to use it?

Global settings for all forms in config.neon

recaptcha:
    secretKey: <secretKey>
    siteKey: <siteKey>
    minimalScore: 0.5

Or you can define it for each form separately.

$form->addInvisibleReCaptcha('recaptcha')
    ->setMinimalScore(0.6);

Or you can have the score set globally and then set it differently for some forms. The score set in the form has a higher priority.

f3l1x commented 10 months ago

👍 Thanks

bohacf commented 9 months ago

See issue #65 , in reCaptcha 2 is problem with nonexisting $answer['score']