Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

System.InvalidOperationException: Reponse is emptry. #56

Open
edika99 opened this issue Feb 17, 2021 · 1 comment
Open

System.InvalidOperationException: Reponse is emptry. #56

edika99 opened this issue Feb 17, 2021 · 1 comment

Comments

@edika99
Copy link
Contributor

edika99 commented Feb 17, 2021

RecaptchaVerificationHelper.txt

I receive the exception if the recaptcha is not filled at all.
I'm using v2 recaptcha.
The excpetion is thrown on

RecaptchaVerificationResult result = recaptcha1.Verify();
at line 104 of RecaptchaVerificationHelper you have to handle the empty response not throwing an exception an retiurning a failed verification.

if (string.IsNullOrEmpty(Response)) { throw new InvalidOperationException("Reponse is emptry."); }
Not filling the recaptcha is equivalent to a failed verification not to an exception.

Attached a working version of RecaptchaVerificationHelper.cs

@sfusaro
Copy link

sfusaro commented May 28, 2024

I am getting the same error.
RecaptchaNet 3.1.0
ApiVersion: 2
Framework: 4.6
Tested with test and productive keys both get the same validation error. When you click on "I'm not a robot" the Verify() method returns OK with the parameters success = true.
If the checkbox is not clicked, the exception occurs: "Reponse is emptry."
Is there a way to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants