1
0

/api/captcha/:id now is of a POST method.

This commit is contained in:
Alexander Andreev 2023-05-09 23:38:23 +04:00
parent 66be82d6b2
commit 2f6bff16b9
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -25,13 +25,13 @@ captcha_refresh.addEventListener("click", async e => {
e.target.disabled = true;
setTimeout(async () => {
e.target.disabled = false;
await fetch(`/api/captcha/${g_current_captcha_id}?remove`); }, 3000);
await fetch(`/api/captcha/${g_current_captcha_id}?remove`, { method: "POST"}); }, 3000);
e_captcha.children[2].value = "";
await getNewCaptcha();
});
// Remove unused CAPTCHA on a server.
window.addEventListener("unload", () => fetch(`/api/captcha/${g_current_captcha_id}?remove`));
window.addEventListener("unload", () => fetch(`/api/captcha/${g_current_captcha_id}?remove`, { method: "POST"}));
setInterval(async () => {
captcha_remain.innerText = --g_captcha_timeout_remain;