db replica base
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user