Fixes the Router situation

This commit is contained in:
Vazhin Tayeb
2021-01-17 22:48:23 +03:00
parent e452802d13
commit e0c8e47112
5 changed files with 49 additions and 40 deletions

View File

@@ -10,25 +10,13 @@ import userManager, { loadUserFromStorage } from "./services/userService";
import AuthProvider from "./utils/authProvider";
import PrivateRoute from "./utils/protectedRoute";
import "./index.css";
import { storeUser } from "./actions/authActions";
function App() {
useEffect(() => {
// Commented out not to check the localStorage for the user's existence ** Temporary **
// fetch current user from cookies
loadUserFromStorage(store);
}, []);
// Should be removed ** Temporary **
//const logUserIn = () => {
// const user = { profile: { given_name: "John Doe" } };
// console.log(`User logged in!`);
// store.dispatch(storeUser(user));
// };
// ** Temporary **
// logUserIn();
return (
<Provider store={store}>
<AuthProvider userManager={userManager} store={store}>