Bedarfsausweis Wohnen API
This commit is contained in:
@@ -7,6 +7,7 @@ import DashboardSidebar from "../components/Dashboard/DashboardSidebar.svelte"
|
||||
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
|
||||
import { createCaller } from "src/astro-typesafe-api-caller";
|
||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
|
||||
import { BenutzerClient } from "#components/Ausweis/types";
|
||||
|
||||
const valid = validateAccessTokenServer(Astro)
|
||||
|
||||
@@ -17,11 +18,11 @@ if (!valid) {
|
||||
|
||||
const caller = createCaller(Astro)
|
||||
|
||||
const benutzer = await caller.user.self.GET.fetch(null, {
|
||||
const benutzer = (await caller.user.self.GET.fetch(undefined, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
|
||||
}
|
||||
})
|
||||
})) || {} as BenutzerClient;
|
||||
|
||||
export interface Props {
|
||||
title: string;
|
||||
@@ -106,7 +107,7 @@ let lightTheme = Astro.cookies.get("theme")?.value === "light";
|
||||
</head>
|
||||
|
||||
<body class="min-h-screen grid md:grid-cols-[300px_1fr]">
|
||||
<DashboardSidebar lightTheme={lightTheme} benutzer={benutzer} client:load></DashboardSidebar>
|
||||
<DashboardSidebar lightTheme={lightTheme} {benutzer} client:load></DashboardSidebar>
|
||||
<main class="p-4 md:p-8 overflow-auto h-screen bg-base-100 pt-20 md:!pt-24">
|
||||
<slot />
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user