1
0
Fork 0

Validate the originUrl against the list of 'github-domains' from the config.

pull/2375/head
Gennady Feldman 2013-10-28 15:32:51 -04:00
parent a4d7fc138a
commit 6419266ea3
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,10 @@ class GitHub
*/ */
public function authorizeOAuth($originUrl) public function authorizeOAuth($originUrl)
{ {
if (!in_array($originUrl, $this->config->get('github-domains'))) {
return false;
}
// if available use token from git config // if available use token from git config
if (0 === $this->process->execute('git config github.accesstoken', $output)) { if (0 === $this->process->execute('git config github.accesstoken', $output)) {
$this->io->setAuthentication($originUrl, trim($output), 'x-oauth-basic'); $this->io->setAuthentication($originUrl, trim($output), 'x-oauth-basic');