feat: basic RBAC support
This commit is contained in:
1 parent
921eef03b3
commit
8547b7807d
13 files changed
+266
-44
No files matched your search
@@ -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}
|
||||
Reference in new issue
Block a user