mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-15 19:50:28 +03:00
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
76c3660cb2
commit
977759145e
2 changed files with 14 additions and 20 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import {
|
||||
BrowserRouter, Switch, Route, Redirect,
|
||||
BrowserRouter,
|
||||
} from 'react-router-dom';
|
||||
|
||||
import { isAuthenticated } from '../../client/state/auth';
|
||||
|
|
@ -11,17 +11,7 @@ import Client from '../templates/client/Client';
|
|||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Switch>
|
||||
<Route exact path="/">
|
||||
{ isAuthenticated() ? <Client /> : <Redirect to="/login" />}
|
||||
</Route>
|
||||
<Route path="/login">
|
||||
{ isAuthenticated() ? <Redirect to="/" /> : <Auth type="login" />}
|
||||
</Route>
|
||||
<Route path="/register">
|
||||
{ isAuthenticated() ? <Redirect to="/" /> : <Auth type="register" />}
|
||||
</Route>
|
||||
</Switch>
|
||||
{ isAuthenticated() ? <Client /> : <Auth />}
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue