From 5cf21c7d75f01bbf939853187ed5f0e81b1dc94b Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 19 Feb 2024 23:38:00 +0100 Subject: [PATCH] finally buildable without jwt --- src/routes/(main)/+layout.server.ts | 6 ++---- src/routes/glaube/+layout.server.ts | 10 +++++----- src/routes/rezepte/+layout.server.ts | 1 - 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/routes/(main)/+layout.server.ts b/src/routes/(main)/+layout.server.ts index 8b5866b..f4f4110 100644 --- a/src/routes/(main)/+layout.server.ts +++ b/src/routes/(main)/+layout.server.ts @@ -1,8 +1,6 @@ -import { get_username } from '$lib/js/get_username';; -import type { Actions, PageServerLoad } from "./$types" -import { error } from "@sveltejs/kit" +import type { PageServerLoad } from "./$types" -export const load = (async ({cookies, locals}) => { +export const load : PageServerLoad = (async ({locals}) => { return { session: await locals.auth(), } diff --git a/src/routes/glaube/+layout.server.ts b/src/routes/glaube/+layout.server.ts index 1cc5acb..f4f4110 100644 --- a/src/routes/glaube/+layout.server.ts +++ b/src/routes/glaube/+layout.server.ts @@ -1,7 +1,7 @@ -import { get_username } from '$lib/js/get_username';; -import type { Actions, PageServerLoad } from "./$types" -import { error } from "@sveltejs/kit" +import type { PageServerLoad } from "./$types" -export const load = (async ({cookies}) => { - return { user: await get_username(cookies) } +export const load : PageServerLoad = (async ({locals}) => { + return { + session: await locals.auth(), + } }); diff --git a/src/routes/rezepte/+layout.server.ts b/src/routes/rezepte/+layout.server.ts index 57ca38d..4410fe4 100644 --- a/src/routes/rezepte/+layout.server.ts +++ b/src/routes/rezepte/+layout.server.ts @@ -1,5 +1,4 @@ import type { PageServerLoad } from "./$types" -import { error } from "@sveltejs/kit" export const load : PageServerLoad = async ({locals}) => { return {