1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

stops redirect from builder/invite if not authed

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-12 11:44:47 +02:00
parent b3c63defb3
commit 05244c86dc

View file

@ -1,6 +1,6 @@
<script>
import { onMount } from "svelte"
import { goto } from "@roxi/routify"
import { page, goto, isActive } from "@roxi/routify"
import { auth } from "stores/backend"
import { admin } from "stores/portal"
@ -22,7 +22,12 @@
// 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")
}
}