Subject: | $c->forward('captcha_check') returns always true, example code accepts all solutions |
From SYNOPSIS:
if ( $c->forward('captcha_check') ) {
$c->detach('my_form_is_ok');
}
The captcha_check always returns true, so the example code accepts all
captchas. Fix is simple:
--- a/lib/perl5/Catalyst/TraitFor/Controller/reCAPTCHA.pm
+++ b/lib/perl5/Catalyst/TraitFor/Controller/reCAPTCHA.pm
@@ -52,6 +52,7 @@ sub captcha_check :Private {
}
$c->stash( recaptcha_ok => $res->{is_valid} );
+ return $res->{is_valid};
}
1;