diff --git a/internal/commands/token/rm.go b/internal/commands/token/rm.go index 0c021c1..3e0daf6 100644 --- a/internal/commands/token/rm.go +++ b/internal/commands/token/rm.go @@ -67,11 +67,12 @@ func runRemove(streams command.Streams, hubClient *hub.Client, opts removeOption } if !opts.force { + fmt.Fprintf(streams.Out(), ansi.Warn("WARNING: This action is irreversible.")+` By confirming, you will permanently delete the access token. -Deleting a token will invalidate your credentials on all Docker clients currently authenticated with this token. +Removing the tokens will invalidate your credentials on all Docker clients currently authenticated with the tokens. -Please type your username %q to confirm deletion: `, hubClient.AuthConfig.Username) +Please type your username %q to confirm token deletion: `, hubClient.AuthConfig.Username) reader := bufio.NewReader(streams.In()) input, _ := reader.ReadString('\n') input = strings.ToLower(strings.TrimSpace(input)) @@ -83,6 +84,6 @@ Please type your username %q to confirm deletion: `, hubClient.AuthConfig.Userna if err := hubClient.RemoveToken(u.String()); err != nil { return err } - fmt.Fprintln(streams.Out(), ansi.Emphasise("Deleted"), u) + fmt.Fprintln(streams.Out(), ansi.Emphasise("Access token deleted"), u) return nil } diff --git a/pkg/hub/client.go b/pkg/hub/client.go index 0f8f098..6bb3717 100644 --- a/pkg/hub/client.go +++ b/pkg/hub/client.go @@ -144,6 +144,7 @@ func WithOutStream(out io.Writer) ClientOp { // WithHubAccount sets the current account name func WithHubAccount(account string) ClientOp { return func(c *Client) error { + c.AuthConfig.Username = account c.account = account return nil }