Browse Source

commands: Fix up the interactive auth flow

Fixes up the interactive authorization workflow so that
pass is reassigned properly.

For T692
pull/43/head
Christopher Davis 4 years ago
parent
commit
f2bb9f5896
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      commands/commands.go

+ 4
- 3
commands/commands.go View File

@@ -410,17 +410,18 @@ func CmdAuth(c *cli.Context) error {

// Take password from argument, and fall back to input
pass := c.String("p")
if len(pass) == 0 {
if pass == "" {
fmt.Print("Password: ")
pass, err := gopass.GetPasswdMasked()
enteredPass, err := gopass.GetPasswdMasked()
if err != nil {
return cli.NewExitError(fmt.Sprintf("error reading password: %v", err), 1)
}

// Validate password
if len(pass) == 0 {
if len(enteredPass) == 0 {
return cli.NewExitError("Please enter your password.", 1)
}
pass = string(enteredPass)
}

if config.IsTor(c) {


Loading…
Cancel
Save