diff --git a/cli/login.go b/cli/login.go index 73a18a1c40009..2727743e1b487 100644 --- a/cli/login.go +++ b/cli/login.go @@ -278,8 +278,7 @@ func (r *RootCmd) login() *clibase.Cmd { } sessionToken, err = cliui.Prompt(inv, cliui.PromptOptions{ - Text: "Paste your token here:", - Secret: true, + Text: "Paste your token here:", Validate: func(token string) error { client.SetSessionToken(token) _, err := client.User(ctx, codersdk.Me) diff --git a/cli/login_test.go b/cli/login_test.go index 89d4cd87b37d9..3bda6bcd1d22f 100644 --- a/cli/login_test.go +++ b/cli/login_test.go @@ -3,6 +3,7 @@ package cli_test import ( "context" "fmt" + "runtime" "testing" "github.com/stretchr/testify/assert" @@ -170,6 +171,10 @@ func TestLogin(t *testing.T) { pty.ExpectMatch("Paste your token here:") pty.WriteLine(client.SessionToken()) + if runtime.GOOS != "windows" { + // For some reason, the match does not show up on Windows. + pty.ExpectMatch(client.SessionToken()) + } pty.ExpectMatch("Welcome to Coder") <-doneChan }) @@ -193,6 +198,10 @@ func TestLogin(t *testing.T) { pty.ExpectMatch("Paste your token here:") pty.WriteLine("an-invalid-token") + if runtime.GOOS != "windows" { + // For some reason, the match does not show up on Windows. + pty.ExpectMatch("an-invalid-token") + } pty.ExpectMatch("That's not a valid token!") cancelFunc() <-doneChan