1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-12-22 09:42:31 +01:00

Fix publish command preferring default user instead of token auth

Closes #650
This commit is contained in:
Alexandre Oliveira 2023-03-03 17:49:18 +01:00
parent b62204054f
commit 9d42ee9391

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 {