From 34986560c86bf9a104a2c7211357f46f76af3cfc Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:38:31 -0700 Subject: [PATCH] Added bannend check --- apps/dispatch/app/layout.tsx | 9 ++++++--- apps/hub/app/(app)/layout.tsx | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/dispatch/app/layout.tsx b/apps/dispatch/app/layout.tsx index 21ee4fe2..905058f5 100644 --- a/apps/dispatch/app/layout.tsx +++ b/apps/dispatch/app/layout.tsx @@ -6,8 +6,6 @@ import { getServerSession } from "./api/auth/[...nextauth]/auth"; import { Toaster } from "react-hot-toast"; import { QueryProvider } from "_components/QueryProvider"; import { Error as ErrorComp } from "_components/Error"; -import { ErrorBoundary } from "react-error-boundary"; -import { CustomErrorBoundary } from "_components/ErrorBoundary"; const geistSans = localFont({ src: "./fonts/GeistVF.woff", @@ -50,7 +48,12 @@ export default async function RootLayout({ reverseOrder={false} /> - {children} + + {session?.user.isBanned && ( + + )} + {!session?.user.isBanned && children} + diff --git a/apps/hub/app/(app)/layout.tsx b/apps/hub/app/(app)/layout.tsx index 678046b8..e23f6456 100644 --- a/apps/hub/app/(app)/layout.tsx +++ b/apps/hub/app/(app)/layout.tsx @@ -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 ; + if (!session) redirect(`/login`); return (