feat: basic RBAC support

This commit is contained in:
Timothy J. Baek committed 2023-11-18 21:41:43 -08:00
1 parent 921eef03b3
commit 8547b7807d
13 files changed
+266 -44

No files matched your search

+11 -4
View File
@@ -1,12 +1,19 @@
<script>
import { config, user } from '$lib/stores';
import { goto } from '$app/navigation';
import { onMount, tick } from 'svelte';
if ($config && $config.auth && $user === undefined) {
goto('/auth');
}
let loaded = false;
onMount(async () => {
if ($config && $config.auth && $user === undefined) {
await goto('/auth');
}
await tick();
loaded = true;
});
</script>
{#if $config !== undefined}
{#if loaded}
<slot />
{/if}