diff --git a/templates/main.js b/templates/main.js index 9bebf755..72ca66c8 100755 --- a/templates/main.js +++ b/templates/main.js @@ -259,17 +259,15 @@ function onCaptchaLoadTurnstile(action) { action: action, }); if (widgetId === undefined) { - console.error('Could not render Turnstile captcha!'); - return undefined; + return null; } - document.addEventListener('post', function(e) { - // User posted! Reset the captcha. - turnstile.reset(widgetId); - }); return widgetId; }, remove: function(widgetId) { turnstile.remove(widgetId); + }, + reset: function(widgetId) { + turnstile.reset(widgetId); } }; @@ -288,7 +286,6 @@ function onCaptchaLoad(renderer) { }); } -{% if config.dynamic_captcha %} function isDynamicCaptchaEnabled() { let cookie = getCookie('captcha-required'); return cookie === '1';