Add redirecting user from login page to main page after successful login

This commit is contained in:
qowevisa 2024-11-08 19:44:44 +02:00
parent aa5a173e83
commit 92d3a15420

View File

@ -1,4 +1,5 @@
<script>
import { goto } from "$app/navigation";
import { addSuccessToast } from "$lib/components/store";
import Toasts from "$lib/components/Toasts.svelte";
let username = $state("");
@ -23,8 +24,7 @@
credentials: "include", // Important to send cookies with requests
});
addSuccessToast("Login successful!");
// setToken(resp.token);
// goto("/test");
goto("/");
console.log(resp);
} catch (err) {
if (err instanceof Error) {