mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
Update app routing
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user