Neues Login Design und Dashboard
This commit is contained in:
25
src/pages/dashboard/index.astro
Normal file
25
src/pages/dashboard/index.astro
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
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";
|
||||
|
||||
const uid = Astro.cookies.get(API_UID_COOKIE_NAME).value
|
||||
|
||||
if (!uid) {
|
||||
return Astro.redirect("/auth/login")
|
||||
}
|
||||
|
||||
const user = await prisma.benutzer.findUnique({
|
||||
where: {
|
||||
uid
|
||||
}
|
||||
})
|
||||
|
||||
if (!user) {
|
||||
return Astro.redirect("/auth/login")
|
||||
}
|
||||
---
|
||||
|
||||
<UserLayout title="Dashboard">
|
||||
</UserLayout>
|
||||
Reference in New Issue
Block a user