Added dropdown for authentication methods

This commit is contained in:
Josua Frank
2023-03-21 13:40:24 +01:00
parent 442f54de84
commit 35a56dd9e0
5 changed files with 2213 additions and 2192 deletions

View File

@@ -9,11 +9,11 @@ class Ntfy extends NotificationProvider {
let okMsg = "Sent Successfully.";
try {
let headers = {};
if (notification.ntfyusername) {
if (notification.ntfyAuthenticationMethod === "usernamePassword") {
headers = {
"Authorization": "Basic " + Buffer.from(notification.ntfyusername + ":" + notification.ntfypassword).toString("base64"),
};
} else if (notification.ntfyaccesstoken) {
} else if (notification.ntfyAuthenticationMethod === "accessToken") {
headers = {
"Authorization": "Bearer " + notification.ntfyaccesstoken,
};