#187 Server v1 NTFY username password
This commit is contained in:
parent
d52ec8d36f
commit
5614729eab
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user