Update index.js
Browse files
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 |
}
|