add forceResetPassword check to layout

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-21 12:08:18 +02:00
parent 8ca3624e24
commit acc8fc6232
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<script> <script>
import { onMount } from "svelte"
import { isActive, redirect } from "@roxi/routify" import { isActive, redirect } from "@roxi/routify"
import { admin, auth } from "stores/portal" import { admin, auth } from "stores/portal"
import { onMount } from "svelte"
let loaded = false let loaded = false
$: hasAdminUser = !!$admin?.checklist?.adminUser $: hasAdminUser = !!$admin?.checklist?.adminUser
@ -29,6 +29,8 @@
!$isActive("./invite") !$isActive("./invite")
) { ) {
$redirect("./auth/login") $redirect("./auth/login")
} else if ($auth?.user?.forceResetPassword) {
$redirect("./auth/reset")
} }
} }
</script> </script>