actually redirects to terms

This commit is contained in:
Luke Berndt
2024-07-09 07:27:51 -04:00
parent 1cb336f258
commit bb72f1e538
2 changed files with 122 additions and 117 deletions

View File

@@ -8,7 +8,7 @@ import { useNavigate, useLocation } from 'react-router-dom';
*/
const Restricted = ({ children }) => {
const { authenticated, hasAuthenticated,terms } = useSelector((state) => state.user);
const { authenticated, hasAuthenticated, terms } = useSelector((state) => state.user);
const dispatch = useDispatch();
const navigate = useNavigate();
const location = useLocation();
@@ -22,8 +22,9 @@ const Restricted = ({ children }) => {
if (authenticated) {
if ((pathname != "/terms") && (terms != 1.1)) {
navigate("/terms")
} else {
return children;
}
return children;
}
else {
navigate("/login")