This commit is contained in:
Roman Krček
2025-06-19 20:25:36 +02:00
parent 9c94f9c717
commit 58872bada6
18 changed files with 237 additions and 48 deletions

View File

@@ -1,8 +1,19 @@
<script lang="ts">
import '../app.css';
<script>
import { invalidate } from '$app/navigation'
import { onMount } from 'svelte'
let { children } = $props();
let { data, children } = $props()
let { session, supabase } = $derived(data)
onMount(() => {
const { data } = supabase.auth.onAuthStateChange((_, newSession) => {
if (newSession?.expires_at !== session?.expires_at) {
invalidate('supabase:auth')
}
})
return () => data.subscription.unsubscribe()
})
</script>
{@render children()}
{@render children()}