From f2bb9f5896df03fb191b88af0ed3b05fd47a4365 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 6 Sep 2019 09:51:02 -0700 Subject: [PATCH] commands: Fix up the interactive auth flow Fixes up the interactive authorization workflow so that pass is reassigned properly. For T692 --- commands/commands.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/commands.go b/commands/commands.go index c2fc3a8..a87a582 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -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) {