From aa86349d419aa74fec8b67ba226270604f5adba1 Mon Sep 17 00:00:00 2001 From: Sir Blob <76974209+GamerBoss101@users.noreply.github.com> Date: Sun, 26 Jan 2025 03:17:57 -0500 Subject: [PATCH] again --- src/app/(panels)/suite/layout.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/(panels)/suite/layout.jsx b/src/app/(panels)/suite/layout.jsx index 7913eb4..3acc4ae 100644 --- a/src/app/(panels)/suite/layout.jsx +++ b/src/app/(panels)/suite/layout.jsx @@ -26,6 +26,10 @@ export default function RootLayout({ // make sure user only has access to one suite depending on their role // if a user has a role of "caregiver" they should only have access to /suite/doctor/* + console.log(userData.role === "patient" && !router.pathname.startsWith("/suite/patient"), "patient"); + + console.log(userData.role === "doctor" && !router.pathname.startsWith("/suite/doctor"), "doctor"); + if (userData.role === "patient" && !router.pathname.startsWith("/suite/patient")) { router.push("/suite/patient/dashboard"); } else if (userData.role === "doctor" && !router.pathname.startsWith("/suite/doctor")) {