Verbrauchsausweis Gewerbe
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
---
|
||||
import UserLayout from "#layouts/DashboardLayout.astro";
|
||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
|
||||
import { Enums, prisma } from "#lib/server/prisma";
|
||||
import { createCaller } from "src/astro-typesafe-api-caller";
|
||||
import DashboardModule from "#modules/Dashboard/DashboardModule.svelte";
|
||||
|
||||
const caller = createCaller(Astro)
|
||||
import { getCurrentUser } from "#lib/server/user";
|
||||
|
||||
const params = Astro.params;
|
||||
const page = Number(params.page)
|
||||
|
||||
const id = Astro.url.searchParams.get("id") || undefined;
|
||||
|
||||
|
||||
const user = await caller.user.self.GET.fetch(undefined, {
|
||||
headers: {
|
||||
"Authorization": `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
|
||||
}
|
||||
});
|
||||
const user = await getCurrentUser(Astro)
|
||||
|
||||
if (!user) {
|
||||
return Astro.redirect("/auth/login")
|
||||
|
||||
Reference in New Issue
Block a user