Fix jwt-token

This commit is contained in:
2025-09-17 05:28:43 +02:00
parent 25a901ff6c
commit 7404ac747e
3 changed files with 114 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
const { Tenant } = require('../models');
const MultiTenantAuth = require('./multi-tenant-auth');
const securityLogger = require('./logger');
class IPRestrictionMiddleware {
constructor() {
@@ -220,7 +221,12 @@ class IPRestrictionMiddleware {
if (!isAllowed) {
// Log the access attempt for security auditing
console.log(`[SECURITY AUDIT] ${new Date().toISOString()} - IP ${clientIP} denied access to tenant ${tenantId} - User-Agent: ${req.headers['user-agent']}`);
securityLogger.logIPRestriction(
clientIP,
tenantId,
req.headers['user-agent'],
true // denied
);
return res.status(403).json({
success: false,