From 9d42ee93915caded17703c1cc8ef1f5ea7541bac Mon Sep 17 00:00:00 2001 From: Alexandre Oliveira Date: Fri, 3 Mar 2023 17:49:18 +0100 Subject: [PATCH] Fix publish command preferring default user instead of token auth Closes #650 --- cmd/publish.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/publish.go b/cmd/publish.go index aff8065..21578d3 100644 --- a/cmd/publish.go +++ b/cmd/publish.go @@ -171,7 +171,7 @@ func execPublish(c *cli.Context) error { fmt.Fprintf(c.App.ErrWriter, "\r%s\r", strings.Repeat(" ", 20)) } options = append(options, client.WithBasicAuth(user, pass)) - } else if conf.DefaultUser != "" && conf.DefaultPassword != nil { + } else if token == "" && conf.DefaultUser != "" && conf.DefaultPassword != nil { options = append(options, client.WithBasicAuth(conf.DefaultUser, *conf.DefaultPassword)) } if pid > 0 {