randydev commited on
Commit
b7bcb78
·
verified ·
1 Parent(s): d47b766

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -1
index.js CHANGED
@@ -568,7 +568,7 @@ app.post('/api/v1/key/generate-key', authenticateApiKey, apiLimiter, async (req,
568
 
569
  const isBanned = await bannedCollection.findOne({ user_id: userId });
570
  if (isBanned) {
571
- return res.status(200).json({ message: "You are permanently banned from creating API keys" });
572
  }
573
 
574
  const existingUser = await collection.findOne({ owner: userIdNumber });
@@ -578,6 +578,7 @@ app.post('/api/v1/key/generate-key', authenticateApiKey, apiLimiter, async (req,
578
  apiKey: existingUser.key,
579
  createdAt: existingUser.createdAt,
580
  is_banned: existingUser.is_banned || false,
 
581
  owner: existingUser.owner
582
  });
583
  }
 
568
 
569
  const isBanned = await bannedCollection.findOne({ user_id: userId });
570
  if (isBanned) {
571
+ return res.status(200).json({ message: "You are permanently banned from creating API keys", is_deleted: true });
572
  }
573
 
574
  const existingUser = await collection.findOne({ owner: userIdNumber });
 
578
  apiKey: existingUser.key,
579
  createdAt: existingUser.createdAt,
580
  is_banned: existingUser.is_banned || false,
581
+ is_deleted: false,
582
  owner: existingUser.owner
583
  });
584
  }