Update app routing

This commit is contained in:
Hazem Krimi
2021-04-29 19:08:48 +01:00
parent 5a2c6237ea
commit 50b473435f
+8
View File
@@ -1,5 +1,7 @@
import { useEffect } from 'react';
import { Switch } from 'react-router-dom';
import { ProtectedRoute, AuthRoute } from './components';
import { tokenVar } from './graphql/state';
import {
AdditionalInfo,
ForgotPassword,
@@ -10,6 +12,12 @@ import {
} from './pages';
const App = () => {
useEffect(() => {
const token = localStorage.getItem('token');
if (token) tokenVar(token);
}, []);
return (
<Switch>
<ProtectedRoute path='/' exact>