Added bannend check

This commit is contained in:
PxlLoewe
2025-06-02 16:38:31 -07:00
parent bb931ee9d3
commit 34986560c8
2 changed files with 10 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import { HorizontalNav, VerticalNav } from "../_components/Nav";
import { Toaster } from "react-hot-toast";
import { redirect } from "next/navigation";
import { getServerSession } from "../api/auth/[...nextauth]/auth";
import { Error } from "_components/Error";
export const metadata: Metadata = {
title: "VAR: Hub",
@@ -17,6 +18,9 @@ export default async function RootLayout({
}>) {
const session = await getServerSession();
if (session?.user.isBanned)
return <Error title="You are banned from using this service" statusCode={403} />;
if (!session) redirect(`/login`);
return (