diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-11 15:52:42 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-11 15:52:42 -0400 |
| commit | d33c8af14c4adc1c15ab048299e06f9f35ae4de6 (patch) | |
| tree | 5dce8c28876353893dfd4725dcd093afff7e6dff /ui/lib/components/LogIn.svelte | |
| parent | 7bcfeb08946e64642b33f4b099ff235ba8527697 (diff) | |
| parent | 72f3d8c5ab3e2a42cf1a76d0c08815dbe46e50a1 (diff) | |
Merge branch 'wip/login-route'
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; } |
