Skip to content

fix: Confirm password in cli create first user step #1220

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 1 commit into from
May 6, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Apr 29, 2022

This PR asks the user to confirm the password during the create first user step (cli).

Fixes #1182

Example:

coder login http://127.0.0.1:3000
> Your Coder deployment hasn't been set up!
> Would you like to create the first user? (yes/no) yes
> What  username  would you like? (coder) 
> What's your  email ? mathias@coder.com
> Enter a  password : 
> Confirm  password : 
Passwords do not match
> Confirm  password : 
                                                            
  Welcome to Coder, coder! You're authenticated.            

@mafredri mafredri self-assigned this Apr 29, 2022
@mafredri mafredri requested review from johnstcn and a team April 29, 2022 16:07
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

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

Should we make it easier to change the password instead?

Because we automatically authenticate the user after creating, that would work if they mistyped.

@kylecarbs
Copy link
Member

We could always say something like: "Change your password with coder users change-password".

@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #1220 (fe77ec9) into main (35211e2) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1220      +/-   ##
==========================================
+ Coverage   65.63%   65.70%   +0.07%     
==========================================
  Files         269      269              
  Lines       17337    17348      +11     
  Branches      162      162              
==========================================
+ Hits        11379    11399      +20     
+ Misses       4768     4763       -5     
+ Partials     1190     1186       -4     
Flag Coverage Δ
unittest-go-macos-latest 53.00% <100.00%> (+0.07%) ⬆️
unittest-go-postgres- 64.75% <100.00%> (+0.03%) ⬆️
unittest-go-ubuntu-latest 55.31% <100.00%> (-0.05%) ⬇️
unittest-go-windows-2022 52.57% <100.00%> (+0.02%) ⬆️
unittest-js 68.85% <ø> (ø)
Impacted Files Coverage Δ
cli/login.go 55.61% <100.00%> (+2.77%) ⬆️
peerbroker/dial.go 77.04% <0.00%> (-6.56%) ⬇️
coderd/workspaceagents.go 55.59% <0.00%> (-2.56%) ⬇️
peer/conn.go 77.66% <0.00%> (ø)
provisioner/terraform/provision.go 71.39% <0.00%> (+0.43%) ⬆️
provisionerd/provisionerd.go 77.37% <0.00%> (+1.20%) ⬆️
agent/agent.go 68.43% <0.00%> (+2.12%) ⬆️
peerbroker/listen.go 87.39% <0.00%> (+3.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35211e2...fe77ec9. Read the comment docs.

@mafredri
Copy link
Member Author

mafredri commented Apr 29, 2022

Do you think retyping the password would be inconvenient? Would having both would be an option? And is there a chance that the user sets it up on one machine and then tries to log in on another (which might fail without the confirmation prompt)?

@kylecarbs
Copy link
Member

I don't think it's terribly inconvenient I suppose, so I'm not opposed. After your questioning, I agree it's a better flow this way!

@mafredri mafredri merged commit 3dbcddc into main May 6, 2022
@mafredri mafredri deleted the mafredri/verify-create-first-user-password branch May 6, 2022 12:47
@misskniss misskniss mentioned this pull request May 12, 2022
4 tasks
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: cli: Would be nice to have confirm password step for new user and new deployment
3 participants