fixed ipSecurityCheck

This commit is contained in:
2025-11-01 15:17:09 +01:00
parent c7016b5d04
commit 72430462f6
2 changed files with 15 additions and 11 deletions

View File

@@ -84,11 +84,5 @@ export const ipSecurityCheck = (req: AuthRequest, res: Response, next: NextFunct
console.log(`🔐 Auth attempt from IP: ${clientIP}, Path: ${req.path}`);
}
// Block known malicious IPs (you can expand this)
const blockedIPs = process.env.BLOCKED_IPS?.split(',') || [];
if (blockedIPs.includes(clientIP)) {
console.warn(`🚨 Blocked request from banned IP: ${clientIP}`);
res.status(403).json({ error: 'Access denied' });
return;
}
next();
}