Closed pbowyer closed 3 years ago
Can you please try this PR?
use composer require "karser/karser-recaptcha3-bundle:dev-recaptcha-get-score"
to test it.
Inject the Recaptcha3Validator and call getLastResponse()->getScore() after the form was submitted:
<?php
use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3Validator;
class TaskController extends AbstractController
{
public function new(Request $request, Recaptcha3Validator $recaptcha3Validator): Response
{
//...
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
//...
$score = $recaptcha3Validator->getLastResponse()->getScore();
//...
}
//...
}
}
@pbowyer do you still need this?
Hi @karser yes we do, thanks - this works well for us.
Great! I just merged and released it.
Thanks for writing this bundle, it's working flawlessly!
I would like to store the score with our form submissions, so I can verify that we've picked a good score_threshold.
I thought that by mapping the form field I would get the details, but it returns a single long string.
Is it possible to retrieve the CAPTCHA check details?