Move account portal redirect to top of auth level
This commit is contained in:
parent
011193a3dc
commit
33090a2521
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { auth } from "stores/portal"
|
import { auth, admin } from "stores/portal"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import { redirect } from "@roxi/routify"
|
import { redirect } from "@roxi/routify"
|
||||||
|
|
||||||
|
@ -10,6 +10,11 @@
|
||||||
if ($auth.user && !$auth.user.forceResetPassword) {
|
if ($auth.user && !$auth.user.forceResetPassword) {
|
||||||
$redirect("../")
|
$redirect("../")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// redirect to account portal for authentication in the cloud
|
||||||
|
if ($admin.cloud && $admin.accountPortalUrl) {
|
||||||
|
window.location.href = $admin.accountPortalUrl
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,6 @@
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await organisation.init()
|
await organisation.init()
|
||||||
|
|
||||||
// redirect to account portal for login in the cloud
|
|
||||||
if ($admin.cloud && $admin.accountPortalUrl) {
|
|
||||||
window.location.href = $admin.accountPortalUrl
|
|
||||||
}
|
|
||||||
|
|
||||||
loaded = true
|
loaded = true
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// add link to account portal if the user has access
|
// add link to account portal if the user has access
|
||||||
if ($auth.user.account) {
|
if ($auth?.user?.account) {
|
||||||
menu = menu.concat([
|
menu = menu.concat([
|
||||||
{
|
{
|
||||||
title: "Account",
|
title: "Account",
|
||||||
|
|
Loading…
Reference in New Issue