From c89fef26c6e4da8c5eeadb0d9a180516524c1cb3 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Fri, 8 Aug 2025 10:17:57 +0000 Subject: [PATCH] Add additional safety check with window navigation for stuck states cgen-67c5fbd50a11488aa8879c547d0968e1 --- client/pages/Dashboard.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index 3184577d..6595585e 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -58,7 +58,14 @@ export default function Dashboard() { // Force redirect immediately if no user if (!user) { setIsLoading(false); + // Use both React Router and window location as fallback navigate("/login", { replace: true }); + // Fallback in case React Router fails + setTimeout(() => { + if (!user) { + window.location.href = "/login"; + } + }, 500); return; }