Do not ask for credentials again if OTP token is present
parent
be5e4b1589
commit
7e0d8c1bc5
|
@ -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 {
|
||||||
$username = $this->io->ask('Username: ');
|
if (empty($otp) || !$this->io->hasAuthentication($originUrl)) {
|
||||||
$password = $this->io->askAndHideAnswer('Password: ');
|
$username = $this->io->ask('Username: ');
|
||||||
$this->io->setAuthentication($originUrl, $username, $password);
|
$password = $this->io->askAndHideAnswer('Password: ');
|
||||||
|
$otp = null;
|
||||||
|
|
||||||
|
$this->io->setAuthentication($originUrl, $username, $password);
|
||||||
|
}
|
||||||
|
|
||||||
// build up OAuth app name
|
// build up OAuth app name
|
||||||
$appName = 'Composer';
|
$appName = 'Composer';
|
||||||
|
|
Loading…
Reference in New Issue