Confirm password on setup (#1866)

This commit is contained in:
Zachary Wasserman
2018-07-16 10:03:50 -07:00
committed by GitHub
parent e62d2f57df
commit 614fc9d3c5
+11
View File
@@ -62,6 +62,17 @@ func setupCommand() cli.Command {
}
fmt.Println()
flPassword = string(passBytes)
fmt.Print("Confirm Password: ")
passBytes, err = terminal.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
return errors.Wrap(err, "error reading password confirmation")
}
fmt.Println()
if flPassword != string(passBytes) {
return errors.New("passwords do not match")
}
}
token, err := fleet.Setup(flEmail, flPassword, flOrgName)