mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +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 { Switch } from 'react-router-dom';
|
||||||
import { ProtectedRoute, AuthRoute } from './components';
|
import { ProtectedRoute, AuthRoute } from './components';
|
||||||
|
import { tokenVar } from './graphql/state';
|
||||||
import {
|
import {
|
||||||
AdditionalInfo,
|
AdditionalInfo,
|
||||||
ForgotPassword,
|
ForgotPassword,
|
||||||
@@ -10,6 +12,12 @@ import {
|
|||||||
} from './pages';
|
} from './pages';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
const token = localStorage.getItem('token');
|
||||||
|
|
||||||
|
if (token) tokenVar(token);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Switch>
|
<Switch>
|
||||||
<ProtectedRoute path='/' exact>
|
<ProtectedRoute path='/' exact>
|
||||||
|
|||||||
Reference in New Issue
Block a user