|
|
@ -1,6 +1,6 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { onMount } from "svelte" |
|
|
import { onMount } from "svelte" |
|
|
import { goto } from "@roxi/routify" |
|
|
import { page, goto, isActive } from "@roxi/routify" |
|
|
import { auth } from "stores/backend" |
|
|
import { auth } from "stores/backend" |
|
|
import { admin } from "stores/portal" |
|
|
import { admin } from "stores/portal" |
|
|
|
|
|
|
|
|
@ -22,7 +22,12 @@ |
|
|
|
|
|
|
|
|
// Redirect to log in at any time if the user isn't authenticated |
|
|
// Redirect to log in at any time if the user isn't authenticated |
|
|
$: { |
|
|
$: { |
|
|
if (loaded && hasAdminUser && !$auth.user) { |
|
|
if ( |
|
|
|
|
|
!$page.path.includes("/builder/invite") && |
|
|
|
|
|
loaded && |
|
|
|
|
|
hasAdminUser && |
|
|
|
|
|
!$auth.user |
|
|
|
|
|
) { |
|
|
$goto("./auth/login") |
|
|
$goto("./auth/login") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|