fix: wizard loading order and zeroConf
This commit is contained in:
parent
0a491e0522
commit
97ffb7bdf1
17 changed files with 259 additions and 109 deletions
27
new-lamassu-admin/src/routing/PrivateRoute.js
Normal file
27
new-lamassu-admin/src/routing/PrivateRoute.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import React from 'react'
|
||||
import { Route, Redirect } from 'react-router-dom'
|
||||
|
||||
const isAuthenticated = () => {
|
||||
return localStorage.getItem('loggedIn')
|
||||
}
|
||||
|
||||
const PrivateRoute = ({ children, ...rest }) => {
|
||||
return (
|
||||
<Route
|
||||
{...rest}
|
||||
render={({ location }) =>
|
||||
isAuthenticated() ? (
|
||||
children
|
||||
) : (
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: '/login'
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default PrivateRoute
|
||||
Loading…
Add table
Add a link
Reference in a new issue