mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-15 00:53:18 +02:00
Add support for auth in client config
This commit is contained in:
parent
f4f5edb230
commit
b89c18e83d
4 changed files with 18 additions and 5 deletions
cmd
|
@ -162,6 +162,9 @@ func doSubscribe(c *cli.Context, cl *client.Client, conf *client.Config, topic,
|
|||
for filter, value := range s.If {
|
||||
topicOptions = append(topicOptions, client.WithFilter(filter, value))
|
||||
}
|
||||
if s.User != "" && s.Password != "" {
|
||||
topicOptions = append(topicOptions, client.WithBasicAuth(s.User, s.Password))
|
||||
}
|
||||
subscriptionID := cl.Subscribe(s.Topic, topicOptions...)
|
||||
commands[subscriptionID] = s.Command
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue