diff options
Diffstat (limited to 'ui/lib/components/LogIn.svelte')
| -rw-r--r-- | ui/lib/components/LogIn.svelte | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/lib/components/LogIn.svelte b/ui/lib/components/LogIn.svelte index 2836e6d..e1cda8a 100644 --- a/ui/lib/components/LogIn.svelte +++ b/ui/lib/components/LogIn.svelte @@ -1,4 +1,5 @@ <script> + import { goto } from '$app/navigation'; import { logIn } from '$lib/apiServer'; import { currentUser } from '$lib/store'; @@ -6,13 +7,14 @@ let username = ''; let password = ''; - async function handleLogin(event) { + async function handleLogin() { disabled = true; const response = await logIn(username, password); if (200 <= response.status && response.status < 300) { currentUser.update(() => ({ username })); username = ''; password = ''; + goto('/'); } disabled = false; } |
