login user after registration, delete task

This commit is contained in:
Florian Hoss 2022-04-07 15:39:22 +02:00
parent c9063c2fa9
commit 5e63fc1e38
6 changed files with 30 additions and 22 deletions

View file

@ -22,8 +22,8 @@
function submitForm(formData) {
axios({method: 'POST', url: '/auth/register', data: formData})
.then((response) => {
showSuccessToast(response.data.message);
redirect("/login");
setCookie("username", response.data.username, 1);
redirect("/");
})
.catch((err) => {
showErrorToast(err.response.data.message);