You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Verify Function returns an empty string in case that "post_form" fails.
In combination with use strict; this causes an error "Can't use string as HASH ref"
Im not an active user of this module and don't know the quirks of it for this reason Im not creating a pull request
use strict;
# ...
my $response = param( 'g-recaptcha-response' );
my $result = $rc->verify('secret', $response);
if ($result->{success}) { # error right here
# ...
}
Source:
sub verify {
my ($self, $secret, $response, $remoteip) = @_;
if (!defined $secret) {
croak 'Secret key is required to verify reCAPTCHA';
}
if (!defined $response) {
croak 'Response from user is required to verify reCAPTCHA';
}
my $params = {
secret => $secret,
response => $response,
};
$params->{remoteip} = $remoteip if defined $remoteip;
my $res = $self->{ua}->post_form(
$self->{verify_api},
$params
);
if ($res->{success}) {
my $content = decode_json $res->{content};
if ($content->{success}){
return { success => 1 };
} else {
return { success => 0, error_codes => $content->{'error-codes'} };
}
}
# SHOULD HAVE AN ELSE HERE WHICH RETURNS THE APPROPRIATE ERROR HASH
}
The text was updated successfully, but these errors were encountered:
The Verify Function returns an empty string in case that "post_form" fails.
In combination with
use strict;
this causes an error "Can't use string as HASH ref"Im not an active user of this module and don't know the quirks of it for this reason Im not creating a pull request
Source:
The text was updated successfully, but these errors were encountered: