fix: Restore accounts:add and accounts:set functionality #3387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Bug: W-18997338
Issue: #3328
Since the migration of the Heroku Accounts plugin, the
accounts:add
command stopped prompting for a new login. This meant every time the command was executed, it added the same account credentials to a different account name, preventing new accounts from being added or set withaccounts:set
. This PR fixes the issue by re-introducing the CLI login flow required to add new accounts. This PR also reinstates the--sso
functionality the plugin provided.Testing
Note: You'll need access to 2 Heroku accounts. The SSO flow already works with federated accounts and part of this PR just reinstates the functionality. We need to test that new accounts can be added and set.
yarn && yarn build
./bin/run accounts:add personal
- confirm the login flow is prompted with successful login into first Heroku account./bin/run accounts:add personal2
- confirm the login flow is prompted with successful login into second Heroku account./bin/run accounts
- confirm both accounts exist andpersonal2
is currently selected./bin/run accounts:set personal
./bin/run accounts:current
- confirmpersonal
is the currently selected account