Skip to content

Sl/W-18067456 - fix org logout fails username#1282

Merged
WillieRuemmele merged 13 commits into
mainfrom
sl/W-18067456
Apr 21, 2025
Merged

Sl/W-18067456 - fix org logout fails username#1282
WillieRuemmele merged 13 commits into
mainfrom
sl/W-18067456

Conversation

@soridalac
Copy link
Copy Markdown
Contributor

@soridalac soridalac commented Apr 7, 2025

What does this PR do?

fix the issue: Warning users when using sf org logout --target-org >username< without authenticated org correctly.

Step to Reproduce:
Issue:
sf org logout -o haha
actual result: Successfully logged out of orgs: haha

Expected Result:
Warning: No authenticated org found with the username or alias of haha.

What issues does this PR fix or reference?

@W-18067456@

More details: [forcedotcom/cli/issues/3247]

Comment thread test/commands/org/logout.test.ts Outdated
@WillieRuemmele
Copy link
Copy Markdown
Contributor

QA Notes


✅ : now throws error when logging out of non-auth'd / existing org
❓ : does this need standard deprecation of change-in-behavior (non-0 exit)

➜  dreamhouse-agents git:(main) ✗  hub:(GLOBAL - DevHub) scratch:(afdx-usa1000-jwt)
 ➜  sf org logout -o abc --json
{
  "status": 0,
  "result": [
    "abc"
  ],
  "warnings": []
}
➜  dreamhouse-agents git:(main) ✗  hub:(GLOBAL - DevHub) scratch:(afdx-usa1000-jwt)
 ➜  ../../oss/plugin-auth/bin/run.js org logout -o abc --json
{
  "name": "NamedOrgNotFoundError",
  "message": "Parsing --target-org \n\tNo authorization information found for abc.\nSee more help with --help",
  "exitCode": 1,
  "actions": [
    "It looks like you mistyped the username or alias. Did you mean \"apb\"?"
  ],

@soridalac soridalac requested a review from a team as a code owner April 17, 2025 21:37
@WillieRuemmele
Copy link
Copy Markdown
Contributor

QA Notes


✅ : non-breaking changes with warning

 ➜  ../../oss/plugin-auth/bin/run.js org logout -o abc       
Warning: No authenticated org found with the username or alias of abc.
Successfully logged out of orgs: abc
➜  agent  hub:(GLOBAL - DevHub) scratch:(epic.be999e47ad96@orgfarm.out)
 ➜  ../../oss/plugin-auth/bin/run.js org logout -o abc --json
{
  "status": 0,
  "result": [
    "abc"
  ],
  "warnings": [
    {
      "message": "No authenticated org found with the username or alias of abc.",
      "name": "NoAuthFoundForTargetOrgWarning"
    }
  ]
}

Comment thread messages/logout.md Outdated
Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com>
@WillieRuemmele WillieRuemmele merged commit aa25546 into main Apr 21, 2025
15 checks passed
@WillieRuemmele WillieRuemmele deleted the sl/W-18067456 branch April 21, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants