This commit is contained in:
Sir Blob
2025-01-26 03:17:57 -05:00
parent 6379bdf52f
commit aa86349d41

View File

@@ -26,6 +26,10 @@ export default function RootLayout({
// make sure user only has access to one suite depending on their role // 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/* // 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")) { if (userData.role === "patient" && !router.pathname.startsWith("/suite/patient")) {
router.push("/suite/patient/dashboard"); router.push("/suite/patient/dashboard");
} else if (userData.role === "doctor" && !router.pathname.startsWith("/suite/doctor")) { } else if (userData.role === "doctor" && !router.pathname.startsWith("/suite/doctor")) {