Esempio n. 1
0
 public function generateContent()
 {
     try {
         return parent::generateContent();
     } catch (Exception $e) {
         return Json::error($e);
     }
 }
Esempio n. 2
0
 public function generateContent()
 {
     $auth = new HttpAuthentication('https://' . $this->subdomain . '.atlassian.net/', function ($username, $password) {
         $this->jira = new Jira('https://' . $this->subdomain . '.atlassian.net', $username, $password);
         try {
             $this->jira->get('myself');
             return true;
         } catch (Exception $e) {
             return false;
         }
     });
     $credentials = $auth->authenticate();
     if (!$credentials) {
         return new HttpError(401);
     }
     return parent::generateContent();
 }