Setup login flow and some style changes

This commit is contained in:
Alex Selimov 2026-06-01 07:09:37 -04:00
parent fcc59f0afb
commit 608c23d271
10 changed files with 361 additions and 35 deletions

View file

@ -0,0 +1,15 @@
import {redirect} from "@sveltejs/kit"
import type { PageServerLoad } from "./$types"
export const load: PageServerLoad = async ({locals}) => {
const { session, user} = await locals.safeGetSession();
if (!session || !user){
throw redirect(303, "/login");
}
return {
session,
user,
markdown: ''
};
};

View file

@ -1,7 +1,9 @@
<header class="site-header">
<a class="site-logo" href="/">gitKeep</a>
<nav class="site-nav" aria-label="Main navigation">
<a class="login-link" href="#get-started">Logout</a>
<form method="POST" action="/logout">
<button class="login-link" type="submit">Logout</button>
</form>
</nav>
</header>