if user is not logged in redirect

This commit is contained in:
Ludvík Prokopec 2022-12-23 13:54:18 +01:00
parent a73cb6f99c
commit 77c58761af
1 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,13 @@
<script lang="ts">
import { user } from '$lib/auth'
import { Button } from '$lib/components/Common'
import { onMount } from 'svelte'
import { _ } from 'svelte-i18n'
import { navigate } from '$lib/router'
onMount(() => {
if (!$user) navigate('/oauth')
})
</script>
<div class="flex justify-center mt-20">