change paths, add task to db
This commit is contained in:
parent
6a56b03bf6
commit
9e058e4f03
7 changed files with 87 additions and 70 deletions
|
@ -21,13 +21,13 @@
|
|||
userLoggedIn().then((loggedIn) => loggedIn && redirect("/"));
|
||||
|
||||
async function submitForm(formData) {
|
||||
const response = await fetch("/login", {method: 'POST', body: formData, redirect: 'follow'});
|
||||
const response = await fetch("/auth/login", {method: 'POST', body: formData, redirect: 'follow'});
|
||||
if (response.ok) {
|
||||
const json = await response.json();
|
||||
setCookie("username", json.username, 1);
|
||||
redirect("/");
|
||||
} else {
|
||||
redirect("/login");
|
||||
redirect("/view/login");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Reference in a new issue