public function authenticated() { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); return $this->redirect($this->Auth->redirectUrl()); } return $this->redirect($this->Auth->config('loginAction')); }