Hello!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
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);}
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