feat(*): Add basic site functionality including sign up, sign in and sign out

This commit is contained in:
Josh Creek
2024-04-29 20:18:18 +01:00
parent 6794580c01
commit 079ccad6ba
13 changed files with 644 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
<script lang="ts">
import { onDestroy } from 'svelte';
import { user } from '$lib/stores/user.js';
import { type User } from '@supabase/auth-js';
export let data;
let { supabase } = data;
$: ({ supabase } = data);
let localUser: User | null;
const unsubscribe = user.subscribe((value) => {
localUser = value;
});
onDestroy(unsubscribe);
</script>
<div class="h-screen">
{#if localUser}
{localUser?.email}
{:else}
<p>Please log in to view this page</p>
{/if}
</div>