From d25e66ad53862ca5d4528347016b67b8ff020a80 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 30 Oct 2020 17:15:40 +0100 Subject: [PATCH] Display auth again for an origin if the auth type changes --- src/Composer/Util/AuthHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/AuthHelper.php b/src/Composer/Util/AuthHelper.php index cfbfc3760..da36e426b 100644 --- a/src/Composer/Util/AuthHelper.php +++ b/src/Composer/Util/AuthHelper.php @@ -228,9 +228,9 @@ class AuthHelper $authenticationDisplayMessage = 'Using HTTP basic authentication with username "' . $auth['username'] . '"'; } - if ($authenticationDisplayMessage && !in_array($origin, $this->displayedOriginAuthentications, true)) { + if ($authenticationDisplayMessage && (!isset($this->displayedOriginAuthentications[$origin]) || $this->displayedOriginAuthentications[$origin] !== $authenticationDisplayMessage)) { $this->io->writeError($authenticationDisplayMessage, true, IOInterface::DEBUG); - $this->displayedOriginAuthentications[] = $origin; + $this->displayedOriginAuthentications[$origin] = $authenticationDisplayMessage; } } elseif (in_array($origin, array('api.bitbucket.org', 'api.github.com'), true)) { return $this->addAuthenticationHeader($headers, str_replace('api.', '', $origin), $url);