Upgrade to GitHub v3 API
Summary: GitHub dropped support for the v2 API today, which breaks login and registration. Use the v3 API instead. Test Plan: Registered and logged in with GitHub. Verified process pulled email/photo/name/username correctly. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D2726
This commit is contained in:
@@ -60,9 +60,14 @@ final class PhabricatorOAuthLoginController
|
||||
|
||||
$userinfo_uri = new PhutilURI($provider->getUserInfoURI());
|
||||
$userinfo_uri->setQueryParam('access_token', $this->accessToken);
|
||||
$userinfo_uri = (string)$userinfo_uri;
|
||||
|
||||
try {
|
||||
$user_data = @file_get_contents($userinfo_uri);
|
||||
if ($user_data === false) {
|
||||
throw new PhabricatorOAuthProviderException(
|
||||
"Request to '{$userinfo_uri}' failed!");
|
||||
}
|
||||
$provider->setUserData($user_data);
|
||||
} catch (PhabricatorOAuthProviderException $e) {
|
||||
return $this->buildErrorResponse(new PhabricatorOAuthFailureView());
|
||||
|
||||
Reference in New Issue
Block a user