Skip to content

Commit 26ae795

Browse files
authored
fix(sso): Ensure that only one authentication cycle is started. (#1355)
The 'sso' command, when run against a profile with an expired refresh token, would cause two authentication cycles to be started: one by the CLI core before the 'sso' command itself was executed, and then another by the 'sso' command. The second cycle would fail and result in an 'extra' browser tab/window with an error message of "ERROR: no authorization code returned". While the authentication was successful and the new refresh/access/session tokens were stored, this confused the user of the CLI.
1 parent 6a47798 commit 26ae795

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/app/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ func commandCollectsData(command string) bool {
639639
// requires just the authentication server to be running.
640640
func commandRequiresAuthServer(command string) bool {
641641
switch command {
642-
case "profile create", "profile switch", "profile update":
642+
case "profile create", "profile switch", "profile update", "sso":
643643
return true
644644
}
645645
return false
@@ -660,7 +660,7 @@ func commandRequiresToken(command argparser.Command) bool {
660660
}
661661
commandName = strings.Split(commandName, " ")[0]
662662
switch commandName {
663-
case "config", "profile", "update", "version":
663+
case "config", "profile", "sso", "update", "version":
664664
return false
665665
}
666666
return true

0 commit comments

Comments
 (0)