diff --git a/homepage/static/assets/js/captcha_refresh.js b/homepage/static/assets/js/captcha_refresh.js index 47dcbc2..6f686af 100644 --- a/homepage/static/assets/js/captcha_refresh.js +++ b/homepage/static/assets/js/captcha_refresh.js @@ -33,12 +33,13 @@ captcha_refresh.addEventListener("click", async e => { captcha_refresh.disabled = true; setTimeout(async () => { captcha_refresh.disabled = false; - await fetch(`/captcha/${g_current_captcha_id}`); }, 3000); + await fetch(`/captcha/${g_current_captcha_id}?remove`); }, 3000); + document.getElementsByName("captcha_answer")[0].value = ""; await getNewCaptcha(); }); // Remove unused CAPTCHA on a server. -window.addEventListener("unload", () => fetch(`/captcha/${g_current_captcha_id}`)); +window.addEventListener("unload", () => fetch(`/captcha/${g_current_captcha_id}?remove`)); setInterval(async () => { captcha_remain.innerText = --g_captcha_timeout_remain;