randydev commited on
Commit
86aa7e7
·
1 Parent(s): 26eab49
Files changed (1) hide show
  1. plugins/antiban.js +2 -2
plugins/antiban.js CHANGED
@@ -383,7 +383,7 @@ AntibanRoutes.post("/api/v1/user/ban-user", authenticateApiKey, apiLimiter, asyn
383
  return res.status(401).json({ message: "API key not found" });
384
  }
385
 
386
- /* if (existingUserKey.owner === userIdNumber) {
387
  return res.status(200).json({
388
  message: `User ${userIdNumber} cannot be banned because they created the API key`,
389
  is_ban: false
@@ -407,7 +407,7 @@ AntibanRoutes.post("/api/v1/user/ban-user", authenticateApiKey, apiLimiter, asyn
407
  message: `User ${userIdNumber} is a protected admin and cannot be banned`,
408
  is_ban: false
409
  });
410
- } */
411
 
412
  const existingBan = await collection.findOne({ user_ban: userIdNumber });
413
  if (existingBan) {
 
383
  return res.status(401).json({ message: "API key not found" });
384
  }
385
 
386
+ if (existingUserKey.owner === userIdNumber) {
387
  return res.status(200).json({
388
  message: `User ${userIdNumber} cannot be banned because they created the API key`,
389
  is_ban: false
 
407
  message: `User ${userIdNumber} is a protected admin and cannot be banned`,
408
  is_ban: false
409
  });
410
+ }
411
 
412
  const existingBan = await collection.findOne({ user_ban: userIdNumber });
413
  if (existingBan) {