+layout.svelte 344 Bytes
Newer Older
1
2
3
<script>
	import { config, user } from '$lib/stores';
	import { goto } from '$app/navigation';
Timothy J. Baek's avatar
Timothy J. Baek committed
4
	import { onMount, tick } from 'svelte';
5

Timothy J. Baek's avatar
Timothy J. Baek committed
6
7
8
9
10
11
12
13
14
	let loaded = false;
	onMount(async () => {
		if ($config && $config.auth && $user === undefined) {
			await goto('/auth');
		}

		await tick();
		loaded = true;
	});
15
16
</script>

Timothy J. Baek's avatar
Timothy J. Baek committed
17
{#if loaded}
18
19
	<slot />
{/if}