open-webui/src/routes/(app)/+layout.svelte

20 lines
344 B
Svelte
Raw Normal View History

2023-11-19 00:47:12 +00:00
<script>
import { config, user } from '$lib/stores';
import { goto } from '$app/navigation';
2023-11-19 05:41:43 +00:00
import { onMount, tick } from 'svelte';
2023-11-19 00:47:12 +00:00
2023-11-19 05:41:43 +00:00
let loaded = false;
onMount(async () => {
if ($config && $config.auth && $user === undefined) {
await goto('/auth');
}
await tick();
loaded = true;
});
2023-11-19 00:47:12 +00:00
</script>
2023-11-19 05:41:43 +00:00
{#if loaded}
2023-11-19 00:47:12 +00:00
<slot />
{/if}