Dashboard Verbessert
This commit is contained in:
@@ -6,7 +6,20 @@ import "../../svelte-dialogs.config"
|
||||
import "svelte-ripple-action/ripple.css"
|
||||
import DashboardSidebar from "../components/Dashboard/DashboardSidebar.svelte"
|
||||
import { NotificationWrapper } from "@ibcornelsen/ui";
|
||||
import { validateAccessTokenServer } from "src/server/lib/validateAccessToken";
|
||||
import { prisma } from "@ibcornelsen/database/server";
|
||||
import { createCaller } from "#lib/caller";
|
||||
|
||||
const valid = validateAccessTokenServer(Astro)
|
||||
|
||||
if (!valid) {
|
||||
Astro.redirect("/auth/login", 302)
|
||||
}
|
||||
|
||||
|
||||
const caller = createCaller(Astro)
|
||||
|
||||
const benutzer = await caller.v1.benutzer.self()
|
||||
|
||||
export interface Props {
|
||||
title: string;
|
||||
@@ -91,7 +104,7 @@ let lightTheme = Astro.cookies.get("theme").value === "light";
|
||||
</head>
|
||||
|
||||
<body class="min-h-screen grid md:grid-cols-[300px_1fr]">
|
||||
<DashboardSidebar lightTheme={lightTheme} client:load></DashboardSidebar>
|
||||
<DashboardSidebar lightTheme={lightTheme} benutzer={benutzer} client:load></DashboardSidebar>
|
||||
<main class="p-8 overflow-auto h-screen bg-base-100">
|
||||
<slot />
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user