change paths, add task to db

This commit is contained in:
Florian Hoss 2022-04-04 12:13:55 +02:00
parent 6a56b03bf6
commit 9e058e4f03
7 changed files with 87 additions and 70 deletions

View file

@ -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>