better-auth-test / src /routes /+page.svelte
coyotte508
basic app
405fa83
raw
history blame contribute delete
581 Bytes
<script lang="ts">
import { authClient } from "$lib/auth-client";
const session = authClient.useSession();
</script>
<div>
{#if $session.data}
<div>
<p>
{$session?.data?.user.name}
</p>
<button
on:click={async () => {
await authClient.signOut();
}}
>
Sign Out
</button>
</div>
{:else}
<button
on:click={async () => {
await authClient.signIn.social({
provider: "huggingface",
});
}}
>
Continue with Hugging Face
</button>
{/if}
</div>