Skip to content

fix(cli): display pasted session token #9710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 20, 2023
Merged

Conversation

ericpaulsen
Copy link
Member

@ericpaulsen ericpaulsen commented Sep 16, 2023

this PR addresses the coder login flow, and displays the session token when pasted into the terminal (this was the behavior in Coder v1). this change is due to feedback from one of our largest customers:

Users don't know if they've pasted the token, or what they've pasted, leading to double pasting and frequent input errors.

customer issue: https://github.com/coder/customers/issues/287

@ericpaulsen ericpaulsen self-assigned this Sep 16, 2023
@ericpaulsen ericpaulsen changed the title feat(cli): display pasted session token fix(cli): display pasted session token Sep 16, 2023
@ericpaulsen ericpaulsen added bug and removed feature labels Sep 16, 2023
@matifali matifali removed the bug label Sep 17, 2023
johnstcn
johnstcn previously approved these changes Sep 20, 2023
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

Updated the existing unit tests to expect the session token.

@johnstcn
Copy link
Member

Seems like this doesn't fix it on Windows :(

@johnstcn johnstcn dismissed their stale review September 20, 2023 14:01

broken on windows

Comment on lines +174 to +177
if runtime.GOOS != "windows" {
// For some reason, the match does not show up on Windows.
pty.ExpectMatch(client.SessionToken())
}
Copy link
Member

Choose a reason for hiding this comment

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

Manually validated that this works on Windows, just appears to be a weird feature of ptytest. Disabling the session token echo check on Windows for now.

@ericpaulsen ericpaulsen merged commit fae8a47 into main Sep 20, 2023
@ericpaulsen ericpaulsen deleted the display-token-paste branch September 20, 2023 16:42
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants