From 9d3e3ca4865f9360532485ea2547bd6562402d61 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 9 Dec 2016 18:05:17 +0100 Subject: [PATCH] Fix edge case in bitbucket driver --- src/Composer/Repository/Vcs/BitbucketDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/Vcs/BitbucketDriver.php b/src/Composer/Repository/Vcs/BitbucketDriver.php index a1d9a8e26..8a778f7eb 100644 --- a/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -163,7 +163,7 @@ abstract class BitbucketDriver extends VcsDriver } catch (TransportException $e) { $bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process, $this->remoteFilesystem); - if (403 === $e->getCode()) { + if (403 === $e->getCode() || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) { if (!$this->io->hasAuthentication($this->originUrl) && $bitbucketUtil->authorizeOAuth($this->originUrl) ) {