first commit
This commit is contained in:
16
app/admin/page.tsx
Normal file
16
app/admin/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { getServerSession } from "next-auth";
|
||||
import AdminPanel from "../../components/AdminPanel";
|
||||
import { authOptions } from "../../lib/auth";
|
||||
|
||||
export default async function AdminPage() {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (session?.user?.role !== "ADMIN") {
|
||||
return (
|
||||
<div className="rounded border border-dashed border-slate-300 bg-white p-8 text-center">
|
||||
<p className="text-slate-700">Nur fuer Admins.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <AdminPanel />;
|
||||
}
|
||||
Reference in New Issue
Block a user