2023-03-19 10:33:34 +01:00
|
|
|
<script>
|
|
|
|
import { goto } from '$app/navigation';
|
|
|
|
import { onMount } from 'svelte';
|
2023-08-16 20:42:54 +02:00
|
|
|
import {globals} from "$lib/stores.js";
|
|
|
|
|
|
|
|
let globalvars;
|
|
|
|
|
|
|
|
globals.subscribe(value => {
|
|
|
|
globalvars = value;
|
|
|
|
});
|
2023-03-18 18:07:38 +01:00
|
|
|
|
2023-03-19 10:33:34 +01:00
|
|
|
onMount(async () => {
|
2023-08-16 20:42:54 +02:00
|
|
|
if(typeof globalvars.user === 'undefined') {
|
|
|
|
goto("/account/login");
|
|
|
|
}
|
2023-03-19 10:33:34 +01:00
|
|
|
});
|
2023-03-18 18:07:38 +01:00
|
|
|
|
2023-08-16 20:42:54 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if typeof globalvars.user !== 'undefined'}
|
|
|
|
<h1>Welcome {globalvars.user.name}</h1>
|
|
|
|
{/if}
|