Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/cli/auth/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ func LogoutBuilder() *cobra.Command {
var message, entry string
var err error

fromProfile := fmt.Sprintf(" from profile %s?", opts.config.Name())
logoutMessage := fmt.Sprintf("Are you sure you want to log out of profile %s ", opts.config.Name())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove the space and put the space at the beginning all other messages so noAuth scenario doesn't end with <space><question mark>:
Are you sure you want to log out of profile %s ?

switch opts.config.AuthType() {
case config.APIKeys:
entry = opts.config.PublicAPIKey()
message = "Are you sure you want to log out of account with public API key %s" + fromProfile
message = logoutMessage + "with public API key %s?"
case config.ServiceAccount:
entry = opts.config.ClientID()
message = "Are you sure you want to log out of service account %s" + fromProfile
message = logoutMessage + "with service account %s?"
case config.UserAccount:
entry, err = opts.config.AccessTokenSubject()
if err != nil {
Expand All @@ -192,10 +192,10 @@ func LogoutBuilder() *cobra.Command {
return ErrUnauthenticated
}

message = "Are you sure you want to log out of account %s" + fromProfile
message = logoutMessage + "with user account %s?"
case config.NoAuth, "":
entry = opts.config.Name()
message = "Are you sure you want to clear profile %s?"
message = logoutMessage + "?"
}

opts.Entry = entry
Expand Down
Loading