Fix jwt-token
This commit is contained in:
@@ -338,14 +338,14 @@ class AlertService {
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
if (rule.actions.email && user.email) {
|
||||
alertLog = await this.sendEmailAlert(user.email, message, rule, detection, threatAssessment);
|
||||
if (rule.alert_channels.includes('email') && (rule.email || user.email)) {
|
||||
alertLog = await this.sendEmailAlert(rule.email || user.email, message, rule, detection, threatAssessment);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'webhook':
|
||||
if (rule.actions.webhook_url) {
|
||||
alertLog = await this.sendWebhookAlert(rule.actions.webhook_url, detection, device, rule, threatAssessment);
|
||||
if (rule.alert_channels.includes('webhook') && rule.webhook_url) {
|
||||
alertLog = await this.sendWebhookAlert(rule.webhook_url, detection, device, rule, threatAssessment);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -365,8 +365,9 @@ class AlertService {
|
||||
alert_rule_id: rule.id,
|
||||
detection_id: detection.id,
|
||||
alert_type: channel,
|
||||
recipient: channel === 'sms' ? user.phone_number :
|
||||
channel === 'email' ? user.email : rule.webhook_url,
|
||||
recipient: channel === 'sms' ? (rule.sms_phone_number || 'SMS_CONFIGURED') :
|
||||
channel === 'email' ? (rule.email || user.email || 'EMAIL_CONFIGURED') :
|
||||
(rule.webhook_url || 'WEBHOOK_CONFIGURED'),
|
||||
message: message,
|
||||
status: 'failed',
|
||||
error_message: channelError.message,
|
||||
|
||||
Reference in New Issue
Block a user