From e7944b9aa09decca541615f8f848e2c0f7e9d890 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 15 Feb 2024 04:28:31 +0100 Subject: [PATCH] Correctly display user with pfp if available --- src/lib/components/UserHeader.svelte | 18 +++++++++++++----- src/routes/(main)/+layout.svelte | 7 +++---- src/routes/rezepte/+layout.server.ts | 8 ++++---- src/routes/rezepte/+layout.svelte | 6 +++--- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/lib/components/UserHeader.svelte b/src/lib/components/UserHeader.svelte index 0cefa45..65a87b8 100644 --- a/src/lib/components/UserHeader.svelte +++ b/src/lib/components/UserHeader.svelte @@ -1,11 +1,12 @@
@@ -19,6 +18,6 @@ console.log(data)
  • Cloud
  • Searx
  • - +
    diff --git a/src/routes/rezepte/+layout.server.ts b/src/routes/rezepte/+layout.server.ts index 090a40e..57ca38d 100644 --- a/src/routes/rezepte/+layout.server.ts +++ b/src/routes/rezepte/+layout.server.ts @@ -1,8 +1,8 @@ -import type { Actions, PageServerLoad } from "./$types" +import type { PageServerLoad } from "./$types" import { error } from "@sveltejs/kit" -export const load = (async ({cookies, locals}) => { +export const load : PageServerLoad = async ({locals}) => { return { - session: await locals.getSession() + session: await locals.auth() } -}); +}; diff --git a/src/routes/rezepte/+layout.svelte b/src/routes/rezepte/+layout.svelte index 334cbfb..362156b 100644 --- a/src/routes/rezepte/+layout.svelte +++ b/src/routes/rezepte/+layout.svelte @@ -2,9 +2,9 @@ import Header from '$lib/components/Header.svelte' import UserHeader from '$lib/components/UserHeader.svelte'; export let data -let username = "" +let user; if(data.session){ - username = data.session.user.name + user = data.session.user } @@ -16,6 +16,6 @@ if(data.session){
  • Icon
  • Stichwörter
  • - +