Setup login flow and some style changes
This commit is contained in:
parent
fcc59f0afb
commit
608c23d271
10 changed files with 361 additions and 35 deletions
15
src/routes/dashboard/+page.server.ts
Normal file
15
src/routes/dashboard/+page.server.ts
Normal 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: ''
|
||||
};
|
||||
};
|
||||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue