Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1491

General Questions/New to Joomla! 3.x • Re: Google reCaptcha not working on the my websites Joomla 3.10.12

$
0
0
Hello! Can you help me?
Google reCaptcha not working on the page registration on the all my websites (about 50 websites) Joomla 3.10.12
How find is problem?

Thanks
Hello!

In file: plugins/captcha/recaptcha/recaptcha.php

In public function onInit() you need to change
this

Code:

else{// Load callback first for browser compatibilityJHtml::_('script', 'plg_captcha_recaptcha/recaptcha.min.js', array('version' => 'auto', 'relative' => true));$file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag();JHtml::_('script', $file);}
on

Code:

else{// Load callback first for browser compatibility$file = 'https://www.google.com/recaptcha/api.js?render=' . $pubkey;JHtml::_('script', $file);}


In public function onDisplay() you need to add the following code at the beginning of the function:

Code:

$pubkey = $this->params->get('public_key', '');return "<script>grecaptcha.ready(function() {grecaptcha.execute('".$pubkey."', {action: 'homepage'}).then(function(token) {document.getElementById('g-recaptcha-response').value = token;});});</script><input id='g-recaptcha-response' type='hidden' name='g-recaptcha-response' value=''/>";

Change keys in pugins/CAPTCHA - reCAPTCHA to v3

Statistics: Posted by DimSun — Mon Apr 22, 2024 11:28 am



Viewing all articles
Browse latest Browse all 1491

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>