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