Fix jwt-token
This commit is contained in:
@@ -250,7 +250,11 @@ class AlertService {
|
||||
|
||||
// PRIORITY 1: Device-specific filter (most important)
|
||||
if (rule.device_ids && rule.device_ids.length > 0) {
|
||||
if (!rule.device_ids.includes(detection.device_id)) {
|
||||
// Convert both device IDs to strings for consistent comparison
|
||||
const deviceIdStr = String(detection.device_id);
|
||||
const allowedDeviceIds = rule.device_ids.map(id => String(id));
|
||||
|
||||
if (!allowedDeviceIds.includes(deviceIdStr)) {
|
||||
console.log(`❌ Rule "${rule.name}": Device ${detection.device_id} not in allowed devices [${rule.device_ids.join(', ')}]`);
|
||||
return false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user