Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Captcha could not be validated. #8

Closed
helenclarko opened this issue Apr 16, 2015 · 12 comments
Closed

Captcha could not be validated. #8

helenclarko opened this issue Apr 16, 2015 · 12 comments

Comments

@helenclarko
Copy link

After submitting form, an error shows under the nocatcha "Captcha could not be validated."
Form is then not submitted.

Silverstripe 3.1

@UndefinedOffset
Copy link
Owner

Have you checked that the site key and secret key are correct? Are you using Ajax to submit the form? Also double check that you have authorized the domain on google's end.

@helenclarko
Copy link
Author

Site Key and Secret Key are correct. Silverstripe UserForms is being used, so just standard submit.

@UndefinedOffset
Copy link
Owner

I wonder is there client side validation happening per chance from user forms? I'm wondering if that maybe a clue, I'll do some testing on the weekend. It could be seeing it as required and validating it.

@helenclarko
Copy link
Author

Yea, I assumed that the userform wasnt getting the correct response.

@UndefinedOffset
Copy link
Owner

Ya if it's doing client side validation it maybe capturing the submit event which is likely preventing googles code from populating the value needed for the server side validation. You could try turning off the client side validation in the user forms settings. It may help. I'll do some testing on the weekend see if I can figure it out, what version of user forms are you using?

@UndefinedOffset
Copy link
Owner

I just tested with the latest master of userforms and 3.1.12 as well as the latest master of this module. Which is the same as the 0.1.3 tag with the exception of some documentation changes. It seemed to work correctly for me, can you post your composer.lock file?

@helenclarko
Copy link
Author

Hi UndefinedOffset,

I have manually copied all files (not using Composer).
I have just swapped out Spam Protection, nocaptcha and Userforms.
Everytime I submit a form, I recieve an error "Captcha could not be validated".

Is this likely to be the Keys I have entered, or Userforms trying to validate the Nocaptcha field?

@UndefinedOffset
Copy link
Owner

My guess would be that the domain you are using is not allowed for the keys you have setup. Make sure you have allowed the domain you are working off in googles recaptcha panel for the keys.

@UndefinedOffset
Copy link
Owner

Also try var dumping the response variable before this line https://github.com/UndefinedOffset/silverstripe-nocaptcha/blob/master/code/NocaptchaField.php#L141 also try dumping out curl_error($ch), may need to check that function name to be sure I'm right ;). Could be an error too

@helenclarko
Copy link
Author

I believe the keys are working without any issue, If I swap them out for a different domain, it shows an error, something about the keys are not for this domian".

Think we solved the problem. Our servers dont have SSL, so CURL needed to have verify set to false.

@UndefinedOffset
Copy link
Owner

Ok cool you can set that on the config for the field (see the read me) for that, that way you won't have to modify the module :) let me know if the problem is solved and I'll close this issue

@helenclarko
Copy link
Author

All solved.
Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants