AuthComponent::unauthenticated PHP Method

unauthenticated() public method

Handles unauthenticated access attempt.
public unauthenticated ( )
    public function unauthenticated()
    {
        $this->controller->login->logOut(Session::getUserId());
        if ($this->request->isAjax()) {
            return $this->controller->error(401);
        } else {
            $redirect = $this->controller->request->isGet() ? $this->controller->request->uri() : "";
            return $this->controller->redirector->login($redirect);
        }
    }