mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-02-17 07:48:16 +05:30
#372: fix redirect to /login page
This commit is contained in:
parent
8e998e456c
commit
46217d8cd1
@ -12,10 +12,7 @@ const PrivateRoute = ({user, component: Component, ...rest}: {
|
|||||||
}) => (
|
}) => (
|
||||||
<Route {...rest} render={(props: {location: string}) => (
|
<Route {...rest} render={(props: {location: string}) => (
|
||||||
user.isGuest ? (
|
user.isGuest ? (
|
||||||
<Redirect to={{
|
<Redirect to="/login" />
|
||||||
pathname: '/login',
|
|
||||||
state: { from: props.location }
|
|
||||||
}}/>
|
|
||||||
) : (
|
) : (
|
||||||
<Component {...props}/>
|
<Component {...props}/>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user