{"issue":{"created_at":"2011-12-10T11:59:56Z","state":"open","updated_at":"2011-12-10T11:59:56Z","user":{"gravatar_id":"9dfd57cdb85ea34ee0a27d28815798ae","id":122379,"url":"https://api.github.com/users/mcallisto","avatar_url":"https://secure.gravatar.com/avatar/9dfd57cdb85ea34ee0a27d28815798ae?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"mcallisto"},"comments":0,"body":"Hi miles,\r\n\r\nI am testing your 2.0 version and it seems to me there is something to be better analyzed, I will share some temporary idea.\r\n\r\nWhen you startup() method tries to login the user with the data stored in the cookie, it uses\r\n\r\n    if ($this->Auth->login($cookie)) {\r\n\r\nI'm quite sure this is not working, see the book\r\nhttp://book.cakephp.org/2.0/en/core-libraries/components/authentication.html\r\nwhere it says:\r\n> **WARNING**:\r\n> *In 2.0 $this->Auth->login($this->request->data) will log the user in with whatever data is posted,*\r\n> *whereas in 1.3 $this->Auth->login($this->data) would try to identify the user first and only log in when successful.*\r\n\r\nSo I made it working changing the code into something like:\r\n\r\n    $controller->request->data['User'] = array(\r\n      'username' => $cookie['username'],\r\n      'password' => 'banana' // test password before hashing\r\n    );\r\n    \r\n    if ($this->Auth->login()) {\r\n\r\nsimulating a POST request from the user with the login data.\r\n\r\nProblem is that the password from the cookie contained in $cookie['password'] is hashed and won't work for login...\r\n\r\nI'll keep thinking about it and come back.\r\n\r\n\r\n\r\n","assignee":null,"id":2510760,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":12,"title":"Auth->login()","html_url":"https://github.com/milesj/cake-auto_login/issues/12","closed_at":null,"url":"https://api.github.com/repos/milesj/cake-auto_login/issues/12","milestone":null},"action":"opened"}