import { Route, Redirect } from "react-router-dom"; import * as Cookie from "js-cookie"; import authenticationService from "core/services/common-services/authentication-service"; import App from "app/App"; const PrivateRoute = ({ ...rest }) => { return ( { //Fake authentication data: const currentUser = authenticationService.currentUserValue || {}; const token = Cookie.get("Token") || "Token"; if (!currentUser || !token) { return ( ); } return ; }} /> ); }; export default PrivateRoute;