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

@@ -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}
/>
<QueryProvider>
<NextAuthSessionProvider session={session}>{children}</NextAuthSessionProvider>
<NextAuthSessionProvider session={session}>
{session?.user.isBanned && (
<ErrorComp title="You are banned from using this service" statusCode={403} />
)}
{!session?.user.isBanned && children}
</NextAuthSessionProvider>
</QueryProvider>
</body>
</html>