You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 26, 2018. It is now read-only.
Hello! I need to implement authentication mechanics to my application and so instead of starting from scratch I've used React-Router auth-flow example as example.
I'm facing a strange problem: from the Login component (roughly the same as the example above) I should be able to redirect to the previous visited route if auth is successfull:
if(loggedIn){const{ location, history }=this.props;if(location.state&&location.state.nextPathname){history.replaceState(null,location.state.nextPathname);}else{history.replaceState(null,'/');}}
This path should be stored inside the location state object by the onEnter hook on a protected route:
If I use this logic with redux-simple-route, inside the Login component the props this.location.state is null, while, if disabled, contains the right nextPathname property.
I think I've narrowed down the problem to these lines of redux-simple-router (68-71):