Recaptcha v3 Broken
-
In file includes/Fields/Recaptcha.php line 52 there is no logic to provide the appropriate configured key for v3 captcha
public function localize_settings( $settings, $form ) { $settings['site_key'] = Ninja_Forms()->get_setting( 'recaptcha_site_key' ); $settings['theme'] = Ninja_Forms()->get_setting( 'recaptcha_theme' ); $settings['theme'] = ( $settings['theme'] ) ? $settings['theme'] : 'light'; $settings['lang'] = Ninja_Forms()->get_setting( 'recaptcha_lang' ); return $settings; }
If you configure Recaptcha v3 with the appropriate keys, the Recaptcha box doesn’t display on the form. In Goolge Chrome developer console, you’ll see:
recaptcha__en.js:213 Uncaught Error: Missing required parameters: sitekey at un.<anonymous> (recaptcha__en.js:213) at new un (recaptcha__en.js:481) at $B.<anonymous> (recaptcha__en.js:282) at new $B (recaptcha__en.js:464) at recaptcha__en.js:109 at HTMLDivElement.<anonymous> (front-end-deps.js?ver=3.6.7:131) at Function.each (jquery.min.js?ver=3.6.0:2) at s.fn.init.each (jquery.min.js?ver=3.6.0:2) at n.renderCaptcha (front-end-deps.js?ver=3.6.7:122) at p (backbone.min.js?ver=1.4.0:2)
Doing a view source, you’ll see the site_key is set to false.
["recaptcha","input"],"old_classname":"","wrap_template":"wrap","site_key":false,"theme":"light","lang":false}
Adding the appropriate Recaptcha V2 keys results in site_key showing the Recaptcha V2 site key.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Recaptcha v3 Broken’ is closed to new replies.