I have been using Redux Auth Wrapper as of late, which lets you wrap a route in a function that will allow you to check for an authenticated state. Below is an example and you can dig through the repo.
In my store.js file, I have the following, which looks for a user object on the authReducer.
export const userIsAuthenticated = userAuthWrapper({
authSelector: state => state.authReducer.user,
redirectAction: routerActions.replace,
failureRedirectPath: '/login',
wrapperDisplayName: 'userIsAuthenticated',
});
I use this along with react router to protect certain routes: Non authenticated route:
<Route path="/events/:eventId" component={Pages.EventPage} />
Authenticated route:
<Route path="/create-event" component={userIsAuthenticated(Pages.CreateEventPage)} />