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 %s %s request.', | ||||
PhabricatorPlatformSite::getName(), | |||||
'user.whoami'), | 'user.whoami'), | ||||
$ex); | $ex); | ||||
} | } | ||||
} | } | ||||
private function getPhabricatorURI($path) { | private function getPhabricatorURI($path) { | ||||
return rtrim($this->phabricatorBaseURI, '/').'/'.ltrim($path, '/'); | return rtrim($this->phabricatorBaseURI, '/').'/'.ltrim($path, '/'); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0