@@ -3,7 +3,7 @@ import {
|
||||
BrowserRouter, Switch, Route, Redirect,
|
||||
} from 'react-router-dom';
|
||||
|
||||
import { isAuthanticated } from '../../client/state/auth';
|
||||
import { isAuthenticated } from '../../client/state/auth';
|
||||
|
||||
import Auth from '../templates/auth/Auth';
|
||||
import Client from '../templates/client/Client';
|
||||
@@ -13,13 +13,13 @@ function App() {
|
||||
<BrowserRouter>
|
||||
<Switch>
|
||||
<Route exact path="/">
|
||||
{ isAuthanticated() ? <Client /> : <Redirect to="/login" />}
|
||||
{ isAuthenticated() ? <Client /> : <Redirect to="/login" />}
|
||||
</Route>
|
||||
<Route path="/login">
|
||||
{ isAuthanticated() ? <Redirect to="/" /> : <Auth type="login" />}
|
||||
{ isAuthenticated() ? <Redirect to="/" /> : <Auth type="login" />}
|
||||
</Route>
|
||||
<Route path="/register">
|
||||
{ isAuthanticated() ? <Redirect to="/" /> : <Auth type="register" />}
|
||||
{ isAuthenticated() ? <Redirect to="/" /> : <Auth type="register" />}
|
||||
</Route>
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
|
||||
Reference in New Issue
Block a user