1
0
Fork 0

Split non-interactive and bad credential cases

pull/2918/head
Jordi Boggiano 2014-04-11 15:01:20 +02:00
parent b437c1cc05
commit f3c112e9e0
1 changed files with 6 additions and 2 deletions

View File

@ -324,8 +324,8 @@ class RemoteFilesystem
return;
}
// fail if we already have auth or the console is not interactive
if (!$this->io->isInteractive() || $this->io->hasAuthentication($this->originUrl)) {
// fail if the console is not interactive
if (!$this->io->isInteractive()) {
if ($httpStatus === 401) {
$message = "The '" . $this->fileUrl . "' URL required authentication.\nYou must be using the interactive console to authenticate";
}
@ -335,6 +335,10 @@ class RemoteFilesystem
throw new TransportException($message, $httpStatus);
}
// fail if we already have auth
if ($this->io->hasAuthentication($this->originUrl)) {
throw new TransportException("Invalid credentials for '" . $this->fileUrl . "', aborting.", $httpStatus);
}
$this->io->overwrite(' Authentication required (<info>'.parse_url($this->fileUrl, PHP_URL_HOST).'</info>):');
$username = $this->io->ask(' Username: ');