public function login(){ if ($this->request->isPost()) { $user = $this->Auth->identify(); if(!empty($user)){ $this->Auth->setUser($user); return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error('ユーザー名またはパスワードが間違っています'); } }