diff --git a/frontend/src/Main.tsx b/frontend/src/Main.tsx index 38884d45..6377b8ba 100644 --- a/frontend/src/Main.tsx +++ b/frontend/src/Main.tsx @@ -50,9 +50,11 @@ const Main: FC = ({ children }) => { location.pathname !== ROUTE_FORGOT_PASSWORD && location.pathname !== ROUTE_RESET_PASSWORD ) { - navigate( - `${ROUTE_LOGIN}?redirect=${encodeURIComponent(location.pathname)}` - ); + const redirect = + location.pathname === "/" + ? "" + : `?redirect=${encodeURIComponent(location.pathname)}`; + navigate(`${ROUTE_LOGIN}${redirect}`); } }, [loading, user, location, navigate]);