Open DanHalford opened 6 months ago
You're passing the ASP.NET Core Antiforgery token to the recaptcha service ("__RequestVerificationToken" is the antiforgery token, not the recaptcha token).
You will need to get the value of input[name="g-recaptcha-response"]
and send that as the token
value instead.
This is possibly (almost certainly) a result of my stupidity, but I'm unable to validate a V3 token when submitted via AJAX. Excuse terminology - I'm not a programmer...
On my Razor form, I have this:
This is capturing the token and sending it back, as follows:![image](https://github.com/michaelvs97/AspNetCore.ReCaptcha/assets/1879098/06a824f3-b891-484e-b8f3-07e838640415)
However, any call to GetVerifyResponseAsync results in an invalid-input-response error code:![image](https://github.com/michaelvs97/AspNetCore.ReCaptcha/assets/1879098/dea402ee-2247-4ae0-b30e-8c715af8a805)
The key and secret are correct - they're working on another page that uses a traditional form post submission.
Any ideas, or am I just terminally dumb?