Added login and authentication

This commit is contained in:
2025-10-03 11:39:20 +02:00
parent 96388e5a50
commit c695d6c733
9 changed files with 434 additions and 13 deletions

View File

@@ -1,12 +1,28 @@
<script lang="ts">
import "../app.css";
import favicon from "$lib/assets/favicon.svg";
import { afterNavigate } from "$app/navigation";
import { isAuthenticated } from "$lib/Auth.svelte";
let { children } = $props();
let renderit = $state(false);
afterNavigate(() => {
isAuthenticated()
.then(() => {
renderit = true;
})
.catch(() => {
renderit = true;
});
});
</script>
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
{@render children?.()}
{#if renderit}
{@render children?.()}
{/if}