1
0
Fork 0

Merge branch '1.6'

pull/7040/head
Jordi Boggiano 2018-01-24 16:19:39 +01:00
commit f31e2552be
2 changed files with 5 additions and 3 deletions

View File

@ -160,8 +160,8 @@ class DownloadManager
if ($installationSource !== $downloader->getInstallationSource()) { if ($installationSource !== $downloader->getInstallationSource()) {
throw new \LogicException(sprintf( throw new \LogicException(sprintf(
'Downloader "%s" is a %s type downloader and can not be used to download %s', 'Downloader "%s" is a %s type downloader and can not be used to download %s for package %s',
get_class($downloader), $downloader->getInstallationSource(), $installationSource get_class($downloader), $downloader->getInstallationSource(), $installationSource, $package
)); ));
} }

View File

@ -361,7 +361,9 @@ class GitHubDriver extends VcsDriver
} }
} }
$scopesFailed = array_diff($scopesNeeded, $scopesIssued); $scopesFailed = array_diff($scopesNeeded, $scopesIssued);
if (!$headers || count($scopesFailed)) { // non-authenticated requests get no scopesNeeded, so ask for credentials
// authenticated requests which failed some scopes should ask for new credentials too
if (!$headers || !count($scopesNeeded) || count($scopesFailed)) {
$gitHubUtil->authorizeOAuthInteractively($this->originUrl, 'Your GitHub credentials are required to fetch private repository metadata (<info>'.$this->url.'</info>)'); $gitHubUtil->authorizeOAuthInteractively($this->originUrl, 'Your GitHub credentials are required to fetch private repository metadata (<info>'.$this->url.'</info>)');
} }