I have an HTML results page that loads up after a reCAPTCHA V2 challenge is successful with the results of a form completion. The trouble is that I have a javascript countdown I need on the results page that refreshes the page when the countdown expires and the purpose of this is to resubmit the form again. This is causing the reCAPTCHA to challenge again. Here is the javascript:
var timeLeft = 60;
var elem = document.getElementById("countdown");
var timerId = setInterval(countdown, 1000);
function countdown() {
if (timeLeft == -1) {
clearTimeout(timerId);
elem.innerHTML = " Checking again...";
setTimeout(function () {
window.location.reload();
});
} else {
elem.innerHTML = timeLeft + " seconds until new check";
timeLeft--;
}
}
How do I stop reCAPTCHA from challenging on reload? I am using a Python, Flask backend rendering the HTML template.