fix login.js 0.147
All checks were successful
Build Docker / deploy (push) Successful in 45s
Build Docker / build (push) Successful in 44s

This commit is contained in:
2026-03-19 01:58:13 +03:00
parent 25ec2c7bcb
commit 185cefe250

View File

@@ -17,12 +17,12 @@ document.getElementById('loginForm').addEventListener('submit', async function (
const response = await fetch("https://ru.homyk.space/api/auth", { const response = await fetch("https://ru.homyk.space/api/auth", {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/json",
}, },
body: new URLSearchParams({ body: JSON.stringify({
password: userData.password password: userData.password
}), }),
}); });
const data = await response.json(); // читаем только один раз const data = await response.json(); // читаем только один раз
if (response.ok) { // сохраняем только при успехе if (response.ok) { // сохраняем только при успехе