From 05f5001fc7d325e31d9c777be11343604c72fbfd Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 2 Aug 2022 10:06:57 -0700 Subject: catch login and registration errors --- src/routes/__layout.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/routes') diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 406c29e2..ef4ba1d4 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -9,9 +9,9 @@ import { browser } from '$app/env'; import { goto } from '$app/navigation'; import { LoadingSplash } from '$comp'; + import { protectedRoutes } from '$lib/utils'; browser && ($token ||= $session.token); - let protectedRoutes = [/receive/, /customers/, /dashboard/, /settings/, /transactions/]; let ready = false; onMount(() => { @@ -20,7 +20,7 @@ goto('/login'); toast.push('Please sign in to continue.'); } - user.subscribe((u) => (ready = true)); + user.subscribe((u) => u?.username && (ready = true)); } else { ready = true; } -- cgit v1.2.3