diff options
-rw-r--r-- | cmd/podman/login.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/login.go b/cmd/podman/login.go index 3eacab54a..b02a4b3f9 100644 --- a/cmd/podman/login.go +++ b/cmd/podman/login.go @@ -112,7 +112,7 @@ func loginCmd(c *cliconfig.LoginValues) error { } // If no username and no password is specified, try to use existing ones. - if c.Username == "" && password == "" { + if c.Username == "" && password == "" && userFromAuthFile != "" && passFromAuthFile != "" { fmt.Println("Authenticating with existing credentials...") if err := docker.CheckAuth(ctx, sc, userFromAuthFile, passFromAuthFile, server); err == nil { fmt.Println("Existing credentials are valid. Already logged in to", server) |