I have to implement google invisible recaptcha on my website login page, the scenario is recaptcha challenge(image grid) should be displayed if the user login attempt is more than 5 times, but invisible captcha does not show the image grid, it shows very rarely.
I found that using explicit rendering + immediately calling grecaptcha.execute() after grecaptcha.render() will usually trigger the challenge from this link Force google recaptcha, I tried like this, as our login happens thorugh ajax call when I render again getting "recaptcha already rendered on this element". Is there any other possible way to force the recaptcha challenge? Anaswers are much appreciated
if(typeof widget1 !== 'undefined') {
grecaptcha.reset(widget1);
}
widget1 = grecaptcha.render('test', {
'sitekey' : '6LdmI_0UAAAAABMAMmt7sGWV5v9JZMSeZbW9CVPs',
'callback' : onSuccessfullCaptchaVerification,
'size' : 'invisible'
});
console.log('success!');
grecaptcha.execute(widget1);