diff --git a/main.go b/main.go index 82b7534..688b3f8 100644 --- a/main.go +++ b/main.go @@ -59,7 +59,9 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) { req.Header.Set("Tags", strings.Join(maps.Values(alert.Labels), ",")) username, password := os.Getenv("NTFY_USER"), os.Getenv("NTFY_PASS") - if username != "" && password != "" { + // allow empty `username` (access tokens in Basic Auth leave username empty) + // + if password != "" { req.SetBasicAuth(username, password) }