title: cakephp 2.6.1 ajax login not working
body: <p>Having issues logging in with ajax. Can anyone direct me to some documentation that makes sense. This sounds worrying.</p>
  
  <blockquote>
    <p>In 2.x $this->Auth->login($this->request->data) will log the user in
    with whatever data is posted, whereas in 1.3
    $this->Auth->login($this->data) would try to identify the user first
    and only log in when successful.</p>
  </blockquote>
  
  <pre><code>$data['User']['email'] = "this";
  $data['User']['password'] = "that";
  </code></pre>
  
  <hr>
  
  <pre><code>$data = $this-&gt;request-&gt;input('json_decode', true);
  
  $this-&gt;autoRender = false;
  $this-&gt;response-&gt;type('json');
  
  if ($this-&gt;Auth-&gt;login($data)){
      echo "access";
  } else {
      echo "access denied";
  }
  </code></pre>
  
  <p>It always prints "access".</p>
  
  <p>In AppController.php</p>
  
  <pre><code>'Auth' =&gt; array(
              'loginRedirect' =&gt; array(
                  'controller' =&gt; 'posts',
                  'action' =&gt; 'index'
              ),
              'logoutRedirect' =&gt; array(
                  'controller' =&gt; 'pages',
                  'action' =&gt; 'display',
                  'home'
              ),
              'authenticate' =&gt; array(
                  'Form' =&gt; array(
                      'fields' =&gt; array('username' =&gt; 'email'),
                      'passwordHasher' =&gt; 'Blowfish'
                  ),
              )
          ),
  </code></pre>