forked from tsai/budibase
14 changed files with 82 additions and 26 deletions
@ -1,5 +1,24 @@ |
|||
<script> |
|||
import { redirect } from "@roxi/routify" |
|||
// TODO: need to check if the tenant is already set |
|||
$redirect("./org") |
|||
import { auth, admin } from "stores/portal" |
|||
import { onMount } from "svelte" |
|||
|
|||
$: tenantSet = $auth.tenantSet |
|||
$: multiTenancyEnabled = $admin.multiTenancy |
|||
|
|||
let loaded = false |
|||
|
|||
$: { |
|||
console.log(loaded) |
|||
if (loaded && multiTenancyEnabled && !tenantSet) { |
|||
$redirect("./org") |
|||
} else if (loaded) { |
|||
$redirect("./login") |
|||
} |
|||
} |
|||
|
|||
onMount(async () => { |
|||
await admin.init() |
|||
loaded = true |
|||
}) |
|||
</script> |
|||
|
|||
Loading…
Reference in new issue