title: cakephp cakeDC user redirect from login
body: <p>I am using cakeDC's user plugin and I am having an issue when using the routes.</p>
  
  <p>When i go to my domain.com/login I get redirected to my domain.com/users/login with the flash message "You are not authorized to access that location."</p>
  
  <p><strong>Routes.php</strong></p>
  
  <pre><code>CakePlugin::routes();
  Router::connect('/users', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/users/index/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/users/:action/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/users/users/:action/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/login', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'login'));
  Router::connect('/logout', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'logout'));
  Router::connect('/register', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'add'));
  </code></pre>
  
  <p>AppController.php</p>
  
  <pre><code>function beforeFilter() {
      parent::beforeFilter();
      //$this-&gt;Auth-&gt;allow('index');
      $this-&gt;set('logged_in', $this-&gt;Auth-&gt;loggedIn());
      $this-&gt;set('current_user', $this-&gt;Auth-&gt;user());
      $this-&gt;Auth-&gt;fields = array('username' =&gt; 'username', 'password' =&gt; 'passwd');
      $this-&gt;Auth-&gt;loginAction = array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'login', 'admin' =&gt; false);
      $this-&gt;Auth-&gt;loginRedirect = '/';
      $this-&gt;Auth-&gt;authError = __('Sorry, but you need to login to access this location.', true);
      $this-&gt;Auth-&gt;loginError = __('Invalid username / password combination.  Please try again', true);
      $this-&gt;Auth-&gt;autoRedirect = true;
      $this-&gt;Auth-&gt;userModel = 'User';
      $this-&gt;Auth-&gt;userScope = array('User.active' =&gt; 1);
      if ($this-&gt;Auth-&gt;user()) {
          $this-&gt;set('userData', $this-&gt;Auth-&gt;user());
      $this-&gt;set('isAuthorized', ($this-&gt;Auth-&gt;user('id') != ''));
      } 
  }
  </code></pre>