blob: 26346224d4abd87e252e75f6ca989ded40b522a5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<script>
import { page } from '$app/state';
let s = $derived(page.data.session);
</script>
{@debug s}
<h1>SvelteKit Auth Example</h1>
<div>
{#if page.data.session}
{#if page.data.session.user?.image}
<img
src={page.data.session.user.image}
class="avatar"
alt="User Avatar"
/>
{/if}
<span>
<small>Signed in as</small><br />
<strong>{page.data.session.user?.name ?? 'User'}</strong>
</span>
<!-- <div slot="submitButton" class="buttonPrimary">Sign out</div> -->
{:else}
<span class="notSignedInText">You are not signed in</span>
{/if}
</div>
|