improve app setup

This commit is contained in:
Ruben Fiszel
2023-03-27 15:24:13 +02:00
parent 1a6e7b6208
commit 4ea40eef2a
4 changed files with 1150 additions and 2 deletions

View File

@@ -0,0 +1 @@
-- Add down migration script here

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,11 @@
const rd = $page.url.searchParams.get('rd')
onMount(async () => {
await clearUser()
try {
await clearUser()
} catch (err) {
console.error(err)
}
goto(rd ?? '/user/login')
})
</script>

View File

@@ -89,7 +89,7 @@
if (status == '401') {
const url = $page.url
console.log('UNAUTHORIZED', url, url.href.replace(url.origin, ''))
if (url.pathname != '/user/login') {
if (url.pathname != '/user/login' && url.pathname != '/user/logout') {
logoutWithRedirect(url.href.replace(url.origin, ''))
return
}