fix for adding origins only if channel is enabled.

Signed-off-by: Henrik Edegård <henrik.edegard@fortnox.se>
This commit is contained in:
Henrik Edegård
2025-11-06 13:55:11 +00:00
parent b17383c34d
commit a5c2fa22da
@@ -292,10 +292,14 @@ export async function createRouter(
}
// Add config default origins if not in user settings
// Only add origins if the channel is enabled (not explicitly disabled)
const defaultChannelSettings = defaultNotificationSettings?.channels?.find(
c => c.id.toLowerCase() === opts.channel.toLowerCase(),
);
if (defaultChannelSettings?.origins) {
if (
defaultChannelSettings?.origins &&
settings.channels[0].enabled !== false
) {
for (const defaultOrigin of defaultChannelSettings.origins) {
if (
!settings.channels[0].origins.some(