Fix jwt-token

This commit is contained in:
2025-09-17 05:35:12 +02:00
parent f598067a11
commit f29b2d98bc

View File

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