Fix jwt-token

This commit is contained in:
2025-09-15 21:26:15 +02:00
parent 2afbc76817
commit aa930270d4
2 changed files with 42 additions and 18 deletions

View File

@@ -716,9 +716,16 @@ class AlertService {
*/
async checkAlertRules(detection) {
try {
// Get the device to determine tenant context
const device = await Device.findByPk(detection.device_id);
if (!device) {
console.log(`Device ${detection.device_id} not found for detection`);
return [];
}
const rules = await AlertRule.findAll({
where: {
tenant_id: detection.tenant_id,
tenant_id: device.tenant_id,
is_active: true
}
});