From d226cd6ce4f8c00042030e7fdc88eaa0933e1aac Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 6 Aug 2024 11:05:07 -0300 Subject: [PATCH] fix password input lowercasing characters. fixes https://github.com/fiatjaf/nak/issues/28 --- helpers.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helpers.go b/helpers.go index bd2d113..1b4852f 100644 --- a/helpers.go +++ b/helpers.go @@ -261,22 +261,18 @@ func askPassword(msg string, shouldAskAgain func(answer string) bool) (string, e EnableMask: true, MaskRune: '*', } - return _ask(config, msg, "", shouldAskAgain) -} -func _ask(config *readline.Config, msg string, defaultValue string, shouldAskAgain func(answer string) bool) (string, error) { rl, err := readline.NewEx(config) if err != nil { return "", err } - rl.WriteStdin([]byte(defaultValue)) for { answer, err := rl.Readline() if err != nil { return "", err } - answer = strings.TrimSpace(strings.ToLower(answer)) + answer = strings.TrimSpace(answer) if shouldAskAgain != nil && shouldAskAgain(answer) { continue }