I am using react router v4 and trying to implement a functionality where no matter what route the user clicks on, he gets taken to the login page i.e. if he is not logged in
Following this example you can make a component PrivateRoute to wrap Route and use that whenever you need a route that requires auth.
PrivateRoute
Route
This is the component code from the example.
const PrivateRoute = ({ component: Component, ...rest }) => ( ( fakeAuth.isAuthenticated ? () : ( ) )} /> )