Fix bad merge conflict resolution

This commit is contained in:
mabashian 2021-09-29 13:55:30 -04:00
parent 8e34898b4e
commit e5578a8ef3

View File

@ -103,7 +103,11 @@ const ProtectedRoute = ({ children, ...rest }) => {
const location = useLocation();
useEffect(() => {
setAuthRedirectTo(authRedirectTo === '/logout' ? '/' : pathname);
setAuthRedirectTo(
authRedirectTo === '/logout'
? '/'
: `${location.pathname}${location.search}`
);
});
if (isAuthenticated(document.cookie)) {
@ -116,12 +120,6 @@ const ProtectedRoute = ({ children, ...rest }) => {
);
}
setAuthRedirectTo(
authRedirectTo === '/logout'
? '/'
: `${location.pathname}${location.search}`
);
return <Redirect to="/login" />;
};