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 {