sepiariver / recaptchav2

Google's ReCaptcha V2 + V3 for MODX CMS: https://sepiariver.com/modx/recaptchav2-supports-recaptchav3/
https://sepiariver.com/
GNU General Public License v2.0
21 stars 15 forks source link

recaptchav2_invisible_html chunk does not add secret key #42

Closed ghost closed 5 years ago

ghost commented 5 years ago

When I downloaded the most recent update, using the default invisible HTML chunk would return an error document.getElementById(...).submit is not a function

So I double checked the html, and noticed on the webpage the secret key was not being added to the end of the api call.

I swapped out [[++cultureKey]] with [[++recaptchav2.secret_key]] and that got the key to show up in the html.

<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=[[++recaptchav2.secret_key]]"></script>
<script>function recaptchaV2SubmitForm(response){return new Promise(function(){document.getElementById('[[+form_id]]').submit();})}</script>
<input type="submit" class="g-recaptcha submit btn-red btn text-uppercase" name="submit" data-sitekey="[[+site_key]]" data-callback="recaptchaV2SubmitForm" value="Submit Inquiry">

I'm still getting the above issue with the javascript, but figured I should file the issue with the secret key. I'm still debugging the js part.

Apparently you can't name a submit input submit still having the same secret key issue as above

ghost commented 5 years ago

Whoops, thats not what the culture key is for, gonna close this since I must have some other issue