Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/adapter/PhutilPhabricatorAuthAdapter.php
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | protected function loadOAuthAccountData() { | ||||
list($body) = id(new HTTPSFuture($uri))->resolvex(); | list($body) = id(new HTTPSFuture($uri))->resolvex(); | ||||
try { | try { | ||||
$data = phutil_json_decode($body); | $data = phutil_json_decode($body); | ||||
return $data['result']; | return $data['result']; | ||||
} catch (PhutilJSONParserException $ex) { | } catch (PhutilJSONParserException $ex) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Expected valid JSON response from Phabricator %s request.', | 'Expected valid JSON response from "user.whoami" request.'), | ||||
'user.whoami'), | |||||
$ex); | $ex); | ||||
} | } | ||||
} | } | ||||
private function getPhabricatorURI($path) { | private function getPhabricatorURI($path) { | ||||
return rtrim($this->phabricatorBaseURI, '/').'/'.ltrim($path, '/'); | return rtrim($this->phabricatorBaseURI, '/').'/'.ltrim($path, '/'); | ||||
} | } | ||||
} | } |