1
0
Fork 0

Do not ask for credentials again if OTP token is present

pull/2577/head
Chris Smith 2014-01-17 15:38:14 +00:00
parent be5e4b1589
commit 7e0d8c1bc5
1 changed files with 7 additions and 3 deletions

View File

@ -87,9 +87,13 @@ class GitHub
$this->io->write('To revoke access to this token you can visit https://github.com/settings/applications'); $this->io->write('To revoke access to this token you can visit https://github.com/settings/applications');
while ($attemptCounter++ < 5) { while ($attemptCounter++ < 5) {
try { try {
if (empty($otp) || !$this->io->hasAuthentication($originUrl)) {
$username = $this->io->ask('Username: '); $username = $this->io->ask('Username: ');
$password = $this->io->askAndHideAnswer('Password: '); $password = $this->io->askAndHideAnswer('Password: ');
$otp = null;
$this->io->setAuthentication($originUrl, $username, $password); $this->io->setAuthentication($originUrl, $username, $password);
}
// build up OAuth app name // build up OAuth app name
$appName = 'Composer'; $appName = 'Composer';