protected function verifyAuth($helper, InputInterface $input, OutputInterface $output)
{
$composerHome = (new Config($output))->getComposerHomeDir();
$authFile = $composerHome . "/auth.json";
$authObj = [];
if (file_exists($authFile)) {
$authJson = file_get_contents($authFile);
$authObj = (array) json_decode($authJson, true);
if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) {
return true;
}
}
$this->askForAuth($helper, $input, $output);
$authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username;
$authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password;
$authJson = json_encode($authObj);
return file_put_contents($authFile, $authJson);
}