summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/login.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/login.go b/cmd/podman/login.go
index 1fc4d5327..0ae1ed7d0 100644
--- a/cmd/podman/login.go
+++ b/cmd/podman/login.go
@@ -110,7 +110,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)