From d2347de9329532c81f77cfcf880dc19d0fb72aee Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Sun, 19 Jul 2026 03:12:35 +0530 Subject: [PATCH] redirect to login on auth:unauthorized event from AppContent --- src/main.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.jsx b/src/main.jsx index 84a1368..cb97ab6 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -83,6 +83,13 @@ const routerMapping = [ function AppContent() { const { authConfig } = useAppContext(); const navigate = useNavigate(); + + React.useEffect(() => { + const handler = () => navigate("/login"); + window.addEventListener("auth:unauthorized", handler); + return () => window.removeEventListener("auth:unauthorized", handler); + }, [navigate]); + return (