diff options
| author | Adam Soltys <[email protected]> | 2022-08-19 23:13:01 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-19 23:13:01 -0700 |
| commit | b3eefc07a56ea934de126c0d039943edacffa95c (patch) | |
| tree | 125cf73b09bb95eb0a79608f4ee5eaf1442b8e5f /src/routes/+layout.svelte | |
| parent | e126a0ee16178f81c23934829d6d64eef7e8b7fb (diff) | |
| download | coinos-ui-b3eefc07a56ea934de126c0d039943edacffa95c.tar.gz coinos-ui-b3eefc07a56ea934de126c0d039943edacffa95c.zip | |
get login and register working again
Diffstat (limited to 'src/routes/+layout.svelte')
| -rw-r--r-- | src/routes/+layout.svelte | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 8ae80e6c..f2624613 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -6,19 +6,20 @@ import { onMount } from 'svelte'; import { connect } from '$lib/socket'; import { user, token } from '$lib/store'; - import { page, session } from '$app/stores'; + import { page } from '$app/stores'; import { browser } from '$app/env'; import { goto } from '$app/navigation'; import { LoadingSplash } from '$comp'; import { warning, protectedRoutes } from '$lib/utils'; import { _ } from 'svelte-i18n'; - browser && ($token ||= $session.token); + $: $token = data.token + + export let data; let ready = false; onMount(() => { - // get locale from local storage let localStorageLocale = localStorage.getItem('svelte-i18n-locale'); if (localStorageLocale) locale.set(localStorageLocale); @@ -27,6 +28,7 @@ }); if (protectedRoutes.find((p) => $page.url.pathname.match(p))) { + console.log("TOKEN", $token) if (!$token) { goto('/login'); warning($_('error.signIn')); |
