1
登錄我的AppController:Auth->登錄()總是在用戶
public $components = array('Auth' => array(
'authenticate' => array('Blowfish')
),
在我UsersController:
public function login() {
if($this->request->isPost()) {
$this->autoRender = false;
if($this->Auth->login()) {
$this->response->statusCode(200);
}
else {
$this->response->statusCode(401);
}
}
}
而且不管數據發佈到/users/login
的效應初探始終是200和用戶登錄。如何強制Auth不登錄,但在數據庫中檢查用戶名和密碼?
你有什麼你的觀點裏面? – 2013-02-23 21:23:20
請確保您遵循以下指示:http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#using-bcrypt-for-passwords – swiecki 2013-02-24 01:35:21
您是否在'Auth - >允許()'在你之前的過濾器例如? – 2013-02-25 17:12:56