1
0
Fork 0
mirror of synced 2024-07-01 20:41:03 +12:00

Tidy up auth logic in routes

This commit is contained in:
Andrew Kingston 2021-05-06 14:52:20 +01:00
parent ba65dfd718
commit e29df9f45c
2 changed files with 4 additions and 5 deletions

View file

@ -18,7 +18,7 @@
username,
password,
})
notifications.success("Logged in successfully.")
notifications.success("Logged in successfully")
$goto("../portal")
} catch (err) {
console.error(err)

View file

@ -8,12 +8,11 @@
onMount(async () => {
await admin.init()
await auth.checkAuth()
if (!$admin?.checklist?.adminUser) {
$goto("./admin")
} else {
await auth.checkAuth()
checked = true
}
checked = true
})
$: {
@ -23,6 +22,6 @@
}
</script>
{#if $admin.checklist}
{#if checked}
<slot />
{/if}