title: React Router requireAuth not redirecting
body: <p>I have the following routes and requireAuth implementation. I have two problems.</p>
  <blockquote>
  <p>1.) I'm not being redirected from / to /login when I'm not logged in.</p>
  <p>2.) The Home component isn't being rendered when I try to access / and I am logged in.</p>
  </blockquote>
  <p>No console errors are showing up in any use case. I've confirmed that IsLoggedIn() is returning the expected value at the expected times. So my requireAuth implementation is likely to blame here. What did I do wrong?</p>
  <p><strong>index.js</strong></p>
  <pre><code>import { isLoggedIn } from './auth';
  
  function requireAuth(nextState, replace, callback) {
      if (!isLoggedIn()) {
          replace('/login');
      }
  }
  
  render(
      &lt;Provider store={store}&gt;
          &lt;Router history={hashHistory}&gt;
              &lt;Route path=&quot;/&quot; component={Home} onEnter={requireAuth} /&gt;
              &lt;Route path=&quot;/login&quot; component={Login} /&gt;
          &lt;/Router&gt;
      &lt;/Provider&gt;, document.getElementById('root')
  );
  </code></pre>
  <p><strong>auth.js</strong></p>
  <pre><code>module.exports = {
      isLoggedIn() {
          return localStorage.token != undefined;
      }
  };
  </code></pre>