From 9a45c8bc01976305337d0bc91986b8aba833a709 Mon Sep 17 00:00:00 2001 From: Alan Alickovic Date: Sat, 7 Dec 2024 21:52:19 +0100 Subject: [PATCH] fix --- apps/react-vite/src/components/layouts/dashboard-layout.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/react-vite/src/components/layouts/dashboard-layout.tsx b/apps/react-vite/src/components/layouts/dashboard-layout.tsx index 53efa94d..a7bb976f 100644 --- a/apps/react-vite/src/components/layouts/dashboard-layout.tsx +++ b/apps/react-vite/src/components/layouts/dashboard-layout.tsx @@ -77,9 +77,11 @@ const Progress = () => { }; export function DashboardLayout({ children }: { children: React.ReactNode }) { - const logout = useLogout(); - const { checkAccess } = useAuthorization(); const navigate = useNavigate(); + const logout = useLogout({ + onSuccess: () => navigate(paths.auth.login.getHref(location.pathname)), + }); + const { checkAccess } = useAuthorization(); const navigation = [ { name: 'Dashboard', to: paths.app.dashboard.getHref(), icon: Home }, { name: 'Discussions', to: paths.app.discussions.getHref(), icon: Folder },