This is a pretty far-developed starting point. Authentication has been intialized with Better-Auth, a database has been setup with Prisma, and Google + email logins have been enabled, as well as Google + Email registration.
21 lines
530 B
Svelte
21 lines
530 B
Svelte
<script lang="ts">
|
|
import { authClient } from '$lib/auth-client';
|
|
const session = authClient.useSession();
|
|
</script>
|
|
|
|
<nav class="mb-6 flex w-full justify-between bg-slate-200 px-4 py-6">
|
|
<span><a href="/">Radiant Wave Technologies</a></span>
|
|
{#if $session.data}
|
|
<div>
|
|
<a href="/dashboard" class="mx-2">Dashboard</a>
|
|
<button
|
|
on:click={async () => {
|
|
authClient.signOut();
|
|
}}>Log Out</button
|
|
>
|
|
</div>
|
|
{:else}
|
|
<span><a href="/login">Log In</a> | <a href="/register">Register</a></span>
|
|
{/if}
|
|
</nav>
|