Open
Description
Hello,
I have a kind of master details page, something like:
/user
/user/m1
/user/m2
The authentication is defined to the main route user so every nested route must be authenticated, but every time the route change the user component is remount/
This is my setup
export const isUserAuthenticated = connectedRouterRedirect({
// The url to redirect user to if they fail
redirectPath: "/login",
// Determine if the user is authenticated or not
authenticatedSelector: state => state.user != null
// A nice display name for this check
wrapperDisplayName: "UserAuthenticated"
});
<Route path="/user" component={isUserAuthenticated (UserComponent)} />
<Route path="/user/m1" component={M1Component} />
<Route path="/user/m2" component={M2Component} />
Thanks in advance
Note: If I remove the authentication HOC like
<Route path="/user" component={UserComponent} />
everything works fine
Metadata
Metadata
Assignees
Labels
No labels