refactor: avoid repetition of the protected routes component
This commit is contained in:
1 parent
66dc6dbc1a
commit
a70e96f1f3
3 files changed
+26
-32
No files matched your search
@@ -15,7 +15,7 @@ import PropTypes from "prop-types";
|
||||
|
||||
const ProtectedRoute = ({ Component, ...rest }) => {
|
||||
const authState = useSelector((state) => state.auth);
|
||||
|
||||
console.log("Protected");
|
||||
return authState.authToken ? (
|
||||
<Component {...rest} />
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user