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", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Type": "application/json",
},
body: new URLSearchParams({
password: userData.password
body: JSON.stringify({
password: userData.password
}),
});
});
const data = await response.json(); // читаем только один раз
if (response.ok) { // сохраняем только при успехе