fix: wizard loading order and zeroConf

This commit is contained in:
Taranto 2020-10-20 11:24:36 +01:00 committed by Josh Harvey
parent 0a491e0522
commit 97ffb7bdf1
17 changed files with 259 additions and 109 deletions

View 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