From 5614729eabedd95f2e8784b0c7b8c9233d4b5e94 Mon Sep 17 00:00:00 2001 From: Glax Date: Sat, 15 Jun 2024 21:33:42 +0200 Subject: [PATCH] #187 Server v1 NTFY username password --- Tranga/Server.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tranga/Server.cs b/Tranga/Server.cs index 77e2fba..3ea53c7 100644 --- a/Tranga/Server.cs +++ b/Tranga/Server.cs @@ -492,12 +492,13 @@ public class Server : GlobalBase }else if (notificationConnectorType is NotificationConnector.NotificationConnectorType.Ntfy) { if (!requestVariables.TryGetValue("ntfyUrl", out string? ntfyUrl) || - !requestVariables.TryGetValue("ntfyAuth", out string? ntfyAuth)) + !requestVariables.TryGetValue("ntfyUser", out string? ntfyUser)|| + !requestVariables.TryGetValue("ntfyPass", out string? ntfyPass)) { SendResponse(HttpStatusCode.BadRequest, response); break; } - AddNotificationConnector(new Ntfy(this, ntfyUrl, ntfyAuth)); + AddNotificationConnector(new Ntfy(this, ntfyUrl, ntfyUser, ntfyPass, null)); SendResponse(HttpStatusCode.Accepted, response); } else @@ -534,12 +535,13 @@ public class Server : GlobalBase }else if (notificationConnectorType is NotificationConnector.NotificationConnectorType.Ntfy) { if (!requestVariables.TryGetValue("ntfyUrl", out string? ntfyUrl) || - !requestVariables.TryGetValue("ntfyAuth", out string? ntfyAuth)) + !requestVariables.TryGetValue("ntfyUser", out string? ntfyUser)|| + !requestVariables.TryGetValue("ntfyPass", out string? ntfyPass)) { SendResponse(HttpStatusCode.BadRequest, response); break; } - notificationConnector = new Ntfy(this, ntfyUrl, ntfyAuth); + notificationConnector = new Ntfy(this, ntfyUrl, ntfyUser, ntfyPass, null); } else {