vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

CLI installer overwrites existing credentials #7120

Open thorstenfriesen opened 5 months ago

thorstenfriesen commented 5 months ago

Environment

Operating System: Mac OS Node Version: 16 Magento2

Reproduction

  1. Ensure that the ~/.composer/auth.json file already contains Magento credentials or other credentials.
  2. Proceed with the installation process of Vue Storefront using the CLI installer.
  3. Observe that the existing credentials in ~/.composer/auth.json have been overwritten by the new ones.

Describe the bug

Problem: The CLI installer for Vue Storefront asks for Magento credentials during the installation process and overwrites all existing credentials in the ~/.composer/auth.json file. This can cause unintended side effects for developers managing multiple Magento instances or other dependencies via Composer.

Expected Behavior: The installer should not overwrite existing credentials in ~/.composer/auth.json. Instead, it should append new credentials or use them only for the current installation without altering the file.

Current Behavior: Entering Magento credentials in the CLI installer results in all previous entries in ~/.composer/auth.json (http-basic) being replaced.

Additional context

Code Reference: https://github.com/vuestorefront/vue-storefront/blob/269f980e8597dd324bd315683011932ff8325440/packages/cli/src/domains/generate/magento2/prompts/handleMagentoKeys.ts#L50C7-L50C33

Logs

No response