diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index 46db0ab..7bffba7 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -8,15 +8,17 @@ import '../app.css'; const PUBLIC_PATHS = ['/login', '/setup']; + let authChecked = false; onMount(async () => { if (!$isAuthenticated) { await tryRefresh(); } + authChecked = true; }); $: { - if (browser && !$isAuthenticated && !PUBLIC_PATHS.some(p => $page.url.pathname.startsWith(p))) { + if (browser && authChecked && !$isAuthenticated && !PUBLIC_PATHS.some(p => $page.url.pathname.startsWith(p))) { goto('/login'); } } @@ -32,7 +34,11 @@ -{#if $isAuthenticated || PUBLIC_PATHS.some(p => $page.url.pathname.startsWith(p))} +{#if !authChecked} +
+

로딩 중...

+
+{:else if $isAuthenticated || PUBLIC_PATHS.some(p => $page.url.pathname.startsWith(p))} {/if}