public function generateContent() { try { return parent::generateContent(); } catch (Exception $e) { return Json::error($e); } }
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(); }