db replica base

This commit is contained in:
2025-09-22 14:22:46 +03:00
parent d5003b5dcb
commit 79568954bc
6 changed files with 65 additions and 20 deletions

View File

@@ -19,14 +19,16 @@ document.getElementById('loginForm').addEventListener('submit', async function (
password
};
try {
const response = await fetch('http://localhost:8000/login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
const response = await fetch("http://localhost:8000/login", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: JSON.stringify(userData)
});
body: new URLSearchParams({
username: userData.email, // ⚠️ имя поля должно быть username
password: userData.password
}),
});
const data = await response.json(); // читаем только один раз
const remember_me = document.getElementById("remember").checked