mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-05-13 17:11:49 +00:00
draft(DevWeb): Try to resolve redirection
This commit is contained in:
@@ -8,12 +8,16 @@ loginForm.addEventListener("submit", (event) => {
|
||||
formData.forEach((value, key) => data[key] = value);
|
||||
|
||||
fetch(loginForm.getAttribute("action"), {
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify(data),
|
||||
method: loginForm.getAttribute("method"),
|
||||
headers: {"Content-Type": "application/json"}, body: JSON.stringify(data), method: loginForm.getAttribute("method"),
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(d => window.location.href = "./main-menu")
|
||||
.then(res => {
|
||||
if (res.ok) {
|
||||
window.location.href = "./main-menu";
|
||||
}
|
||||
else {
|
||||
// TODO Display red inputs
|
||||
}
|
||||
})
|
||||
.catch(error => console.error("Error:", error));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user