1
0
Fork 0
forked from mirrors/ntfy

Merge pull request #651 from Xinayder/fix-token-auth

Fix publish command preferring default user instead of token auth
This commit is contained in:
Philipp C. Heckel 2023-03-03 13:56:14 -05:00 committed by GitHub
commit 1c6c2cf332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {