From 2a98eca312a5692775ad320b8f6eb4a102d7ffa1 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Thu, 5 Jun 2025 01:23:09 -0700 Subject: [PATCH] enhanced session check --- apps/dispatch/app/dispatch/layout.tsx | 2 +- apps/dispatch/app/pilot/layout.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dispatch/app/dispatch/layout.tsx b/apps/dispatch/app/dispatch/layout.tsx index 0874ec84..d675657d 100644 --- a/apps/dispatch/app/dispatch/layout.tsx +++ b/apps/dispatch/app/dispatch/layout.tsx @@ -16,7 +16,7 @@ export default async function RootLayout({ }>) { const session = await getServerSession(); - if (!session) { + if (!session || !session.user) { redirect("/login"); } diff --git a/apps/dispatch/app/pilot/layout.tsx b/apps/dispatch/app/pilot/layout.tsx index 643d28f4..3c2d1711 100644 --- a/apps/dispatch/app/pilot/layout.tsx +++ b/apps/dispatch/app/pilot/layout.tsx @@ -16,7 +16,7 @@ export default async function RootLayout({ }>) { const session = await getServerSession(); - if (!session) { + if (!session || !session.user) { redirect("/login"); } if (!session.user.emailVerified) {