Skip to content

Commit a21a5f4

Browse files
committed
cli/command: PromptUserForCredentials: always trim password
we don't support empty passwords; when prompting the user for a password, we already trim the result, but we didn't do the same for a password that's passed through stdin or through the `-p` / `--password` flag. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent eda78e9 commit a21a5f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎cli/command/registry.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
155155
}
156156
}
157157

158+
argPassword = strings.TrimSpace(argPassword)
158159
if argPassword == "" {
159160
restoreInput, err := DisableInputEcho(cli.In())
160161
if err != nil {

0 commit comments

Comments
 (0)