diff --git a/server/frontend/auth/login.js b/server/frontend/auth/login.js index 5403018..8230d79 100644 --- a/server/frontend/auth/login.js +++ b/server/frontend/auth/login.js @@ -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) { // сохраняем только при успехе