PDF Designer
This commit is contained in:
@@ -1,22 +1,10 @@
|
||||
---
|
||||
import UserLayout from "../../layouts/UserLayout.astro";
|
||||
import { API_UID_COOKIE_NAME } from "../../lib/constants";
|
||||
import UserModule from "#modules/UserModule.svelte";
|
||||
import { prisma } from "@ibcornelsen/database/server";
|
||||
import { validateAccessTokenServer } from "src/server/lib/validateAccessToken";
|
||||
|
||||
const uid = Astro.cookies.get(API_UID_COOKIE_NAME).value
|
||||
const accessTokenValid = await validateAccessTokenServer(Astro);
|
||||
|
||||
if (!uid) {
|
||||
return Astro.redirect("/auth/login")
|
||||
}
|
||||
|
||||
const user = await prisma.benutzer.findUnique({
|
||||
where: {
|
||||
uid
|
||||
}
|
||||
})
|
||||
|
||||
if (!user) {
|
||||
if (!accessTokenValid) {
|
||||
return Astro.redirect("/auth/login")
|
||||
}
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user