Skip to content
Snippets Groups Projects
Commit c6aca0af authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix admin route

parent 65f2824b
No related branches found
No related tags found
No related merge requests found
...@@ -15,13 +15,11 @@ const PrivateRoute = ({ ...@@ -15,13 +15,11 @@ const PrivateRoute = ({
<Route <Route
{...rest} {...rest}
render={props => { render={props => {
if (!currentUser.isFetched) { if (!currentUser.user && !currentUser.isFetching) {
if (!currentUser.isFetching) { getCurrentUser()
getCurrentUser()
}
return <div>loading</div> return <div>loading</div>
} }
if (!get(currentUser, 'user.admin') || !currentUser.isAuthenticated) { if (!get(currentUser, 'user.admin') || !currentUser.isAuthenticated) {
return ( return (
<Redirect <Redirect
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment