Fix jwt-token
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user