1
0
Fork 0

Fixed OAuth credentials issue for subsequent clone requests.

pull/5055/head
Paul.Wenke 2016-03-13 16:57:23 -04:00
parent d2c5479b2d
commit 9ddf8c4d55
1 changed files with 7 additions and 3 deletions

View File

@ -114,7 +114,7 @@ class Git
return;
}
}
} elseif (preg_match('{^(?:https?|git)://'.self::getBitbucketDomainsRegex($this->config).'/(.*)\.git}', $url, $match)) { //bitbucket oauth
} elseif (preg_match('{^(?:https?|git)://'.self::getBitbucketDomainsRegex($this->config).'/(.*)}', $url, $match)) { //bitbucket oauth
$bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process);
if (!$this->io->hasAuthentication($match[1])) {
@ -127,9 +127,13 @@ class Git
}
} else { //We're authenticating with a locally stored consumer.
$auth = $this->io->getAuthentication($match[1]);
//We already have an access_token from a previous request.
if($auth['username'] !== 'x-token-auth') {
$token = $bitbucketUtil->requestToken($match[1], $auth['username'], $auth['password']);
$this->io->setAuthentication($match[1], 'x-token-auth', $token['access_token']);
}
}
if ($this->io->hasAuthentication($match[1])) {
$auth = $this->io->getAuthentication($match[1]);