/**
  * Blackhold callback
  *
  * OAuth requests will fail postValidation, so rather than disabling it completely
  * if the request does fail this check we store it in $this->blackHoled and then
  * when handling our forms we can use $this->validateRequest() to check if there
  * were any errors and handle them with an exception.
  * Requests that fail for reasons other than postValidation are handled here immediately
  * using the best guess for if it was a form or OAuth
  *
  * @param string $type
  */
 public function blackHole($type)
 {
     $this->blackHoled = $type;
     if ($type != 'auth') {
         if (isset($this->request->data['_Token'])) {
             //Probably our form
             $this->validateRequest();
         } else {
             //Probably OAuth
             $e = new OAuth2ServerException(OAuth2::HTTP_BAD_REQUEST, OAuth2::ERROR_INVALID_REQUEST, 'Request Invalid.');
             $e->sendHttpResponse();
         }
     }
 }