diff --git a/frontend/src/components/Header/Layout.tsx b/frontend/src/components/Header/Layout.tsx index 959d6166..2b3097c7 100644 --- a/frontend/src/components/Header/Layout.tsx +++ b/frontend/src/components/Header/Layout.tsx @@ -24,10 +24,11 @@ export default function Layout(): JSX.Element { !meData.loggedIn && !( location.pathname === "/" || - /\/([a-z]{2})?\/home/.test(location.pathname) + /\/([a-z]{2})\/home/.test(location.pathname) || + location.pathname === `/${i18next.resolvedLanguage}` ) ) { - navigate("/"); + navigate(`${i18next.resolvedLanguage}/home`); } }, [meData.loggedIn, location.pathname, navigate]); @@ -54,4 +55,4 @@ const useEnsureLangCodeInPath = () => { navigate(newPath); } }, [location, navigate]); -}; \ No newline at end of file +};