Fix jwt-token

This commit is contained in:
2025-09-16 21:55:01 +02:00
parent 6ed5c99722
commit 432e4926ee

View File

@@ -18,6 +18,7 @@ router.get('/', authenticateToken, async (req, res) => {
try {
// Get tenant from authenticated user context
const tenantId = req.tenantId;
console.log('🔍 Detections - Tenant ID from request:', tenantId);
if (!tenantId) {
return res.status(400).json({
success: false,
@@ -26,6 +27,7 @@ router.get('/', authenticateToken, async (req, res) => {
}
const tenant = await Tenant.findOne({ where: { slug: tenantId } });
console.log('🔍 Detections - Tenant lookup result:', tenant ? `Found: ${tenant.slug}` : 'Not found');
if (!tenant) {
return res.status(404).json({
success: false,