CSRF header check now covers /login (exemption removed); login.html sends X-Aniweb
This commit is contained in:
1 parent
b70ef403a9
commit
7f531fc309
4 files changed
+16
-6
No files matched your search
+1
-1
@@ -49,7 +49,7 @@ const next = new URLSearchParams(location.search).get("next");
|
||||
async function login() {
|
||||
$("err").textContent = "";
|
||||
const r = await fetch(BASE + "login", {method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
headers: {"Content-Type": "application/json", "X-Aniweb": "1"},
|
||||
body: JSON.stringify({username: $("user").value, password: $("pw").value})});
|
||||
if (r.ok) {
|
||||
location.href = next ? BASE + next.replace(/^\/+/, "") : BASE;
|
||||
|
||||
Reference in new issue
Block a user