Fix jwt-token

This commit is contained in:
2025-09-17 05:50:32 +02:00
parent de552a9322
commit e8ba4b8bd4
2 changed files with 0 additions and 8 deletions

View File

@@ -29,7 +29,6 @@ router.get('/', authenticateToken, async (req, res) => {
// Get tenant from authenticated user context
const tenantId = req.tenantId;
console.log('🔍 Looking for tenant with slug:', tenantId);
if (!tenantId) {
return res.status(400).json({
success: false,
@@ -38,12 +37,6 @@ router.get('/', authenticateToken, async (req, res) => {
}
const tenant = await Tenant.findOne({ where: { slug: tenantId } });
console.log('🔍 Tenant lookup result:', tenant ? `Found tenant ${tenant.slug}` : 'Tenant not found');
// Debug: Let's see what tenants exist
const allTenants = await Tenant.findAll();
console.log('🔍 All tenants in database:', allTenants.map(t => ({ id: t.id, slug: t.slug })));
if (!tenant) {
return res.status(404).json({
success: false,

View File

@@ -39,7 +39,6 @@ describe('Detections Routes', () => {
describe('GET /detections', () => {
it('should return detections for user tenant', async () => {
const tenant = await createTestTenant({ slug: 'test-tenant' });
console.log('🔍 Created tenant:', { id: tenant.id, slug: tenant.slug });
const user = await createTestUser({ tenant_id: tenant.id });
const device = await createTestDevice({ tenant_id: tenant.id });
const detection = await createTestDetection({ device_id: device.id });