diff --git a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx index ef0591d..b927389 100644 --- a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx +++ b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx @@ -83,6 +83,7 @@ const emailSchema = baseSchema.extend({ const ntfySchema = baseSchema.extend({ notification_type: z.literal("ntfy"), ntfy_endpoint: z.string().url("Must be a valid NTFY endpoint URL"), + api_token: z.string().optional(), }); const pushoverSchema = baseSchema.extend({ @@ -595,22 +596,40 @@ export const NotificationChannelDialog = ({ )} {notificationType === "ntfy" && ( - ( - - NTFY Endpoint - - - - - The NTFY endpoint URL including your topic (e.g., https://ntfy.sh/checkcle) - - - - )} - /> + <> + ( + + NTFY Endpoint + + + + + The NTFY endpoint URL including your topic (e.g., https://ntfy.sh/checkcle) + + + + )} + /> + ( + + API Token (Optional) + + + + + Optional API token for authentication with NTFY server + + + + )} + /> + )} {notificationType === "pushover" && ( diff --git a/application/src/services/alertConfigService.ts b/application/src/services/alertConfigService.ts index c76a494..d6f0c30 100644 --- a/application/src/services/alertConfigService.ts +++ b/application/src/services/alertConfigService.ts @@ -88,6 +88,7 @@ export const alertConfigService = { } else if (config.notification_type === "ntfy") { cleanConfig.ntfy_endpoint = config.ntfy_endpoint || ""; + cleanConfig.api_token = config.api_token || ""; } else if (config.notification_type === "pushover") { cleanConfig.api_token = config.api_token || "";