Added ?remove params to clean up fetches to not receive 403 error code.
This commit is contained in:
parent
7c39ad7c3c
commit
3891945371
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user