protected function _processRequest(ApiRequestInterface $request)
 {
     try {
         return $request->get();
     } catch (AccessDeniedException $e) {
         $this->_fortifi->getToken(true);
         return $request->get();
     }
 }
Exemple #2
0
 public static function processRequest(Fortifi $fortifi, ApiRequestInterface $request)
 {
     try {
         return $request->get();
     } catch (AccessDeniedException $e) {
         $token = $fortifi->getToken(true);
         $fortifi->getApi()->setAccessToken($token->accessToken);
         return $request->get();
     }
 }
Exemple #3
0
 /**
  * @param ApiRequestInterface $request
  *
  * @return array
  */
 protected function _makeOptions(ApiRequestInterface $request)
 {
     $options = [];
     if ($request->getVerb() == HttpVerb::POST) {
         $options['json'] = $request->getPostData();
     }
     return $options;
 }
Exemple #4
0
 /**
  * @param ApiRequestInterface $request
  *
  * @return static
  */
 public static function create(ApiRequestInterface $request)
 {
     return $request->get();
 }