forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
494 stars 78 forks source link

2 or more CLI connections with the same username will overwrite each other #2272

Closed ImJohnMDaniel closed 1 year ago

ImJohnMDaniel commented 1 year ago

Summary

If I setup two or more connections, each with the same username, but to different instanceUrl's, the last connection authorized will overwrite the previous connection information.

Steps To Reproduce

1) Authorize to an org with a username 2) Authorize to a second org with a different instanceUrl but the same username. 3) observe that the ~/.sfdx/{username}.json file is overwritten with the new credentials

Expected result

I should be able to authenticate to two or more orgs with same username but different instanceUrls

Actual result

Only the most recent connection remains

System Information

Shell: zsh

{
  "cliVersion": "@salesforce/cli/2.0.0-beta.59",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v18.15.0",
  "osVersion": "Darwin 22.5.0",
  "shell": "zsh",
  "rootPath": "/Users/john/.local/share/sf/client/2.0.0-beta.59-d6bb67f",
  "pluginVersions": [
    "@dx-cli-toolbox/sfdx-toolbox-package-utils 0.8.4 (user)",
    "@dx-cli-toolbox/sfdx-toolbox-utils 0.1.2 (user)",
    "@mshanemc/plugin-streaming 1.1.7 (user)",
    "@mshanemc/sfdx-sosl 1.1.0 (user)",
    "@oclif/plugin-autocomplete 2.3.0 (core)",
    "@oclif/plugin-commands 2.2.16 (core)",
    "@oclif/plugin-help 5.2.10 (core)",
    "@oclif/plugin-not-found 2.3.26 (core)",
    "@oclif/plugin-plugins 3.1.3 (core)",
    "@oclif/plugin-search 0.0.17 (core)",
    "@oclif/plugin-update 3.1.19 (core)",
    "@oclif/plugin-version 1.3.5 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.39 (core)",
    "@oclif/plugin-which 2.2.22 (core)",
    "@salesforce/cli 2.0.0-beta.59 (core)",
    "apex 2.3.3 (core)",
    "auth 2.8.2 (core)",
    "data 2.3.26 (core)",
    "deploy-retrieve 1.13.1 (core)",
    "info 2.6.22 (core)",
    "limits 2.3.22 (core)",
    "login 1.2.13 (core)",
    "org 2.9.14 (core)",
    "packaging 1.20.1 (user)",
    "schema 2.3.14 (core)",
    "settings 1.4.14 (core)",
    "sobject 0.1.26 (core)",
    "source 2.10.15 (core)",
    "telemetry 2.2.1 (core)",
    "templates 55.4.22 (core)",
    "trust 2.4.22 (core)",
    "user 2.3.17 (core)",
    "sfdmu 4.29.2 (user)",
    "shane-sfdx-plugins 4.43.0 (user)"
  ]
}

Additional information

n/a

github-actions[bot] commented 1 year ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.