vuestorefront/vue-storefront

CLI installer overwrites existing credentials

thorstenfriesen opened this issue · 0 comments

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