update
Browse files
index.js
CHANGED
@@ -269,16 +269,16 @@ app.post("/api/v1/revoked-key", async (req, res) => {
|
|
269 |
|
270 |
const existingUser = await collection.findOne({ owner: userIdNumber });
|
271 |
|
|
|
|
|
|
|
|
|
272 |
if (existingUser) {
|
273 |
return res.status(200).json({
|
274 |
is_banned: existingUser.is_banned || false
|
275 |
});
|
276 |
}
|
277 |
|
278 |
-
if (!existingUser) {
|
279 |
-
return res.status(404).json({ error: "API key not found" });
|
280 |
-
}
|
281 |
-
|
282 |
const newKey = generateAkenoKey();
|
283 |
|
284 |
const result = await collection.updateOne(
|
@@ -429,6 +429,7 @@ app.post('/api/v1/generate-key', async (req, res) => {
|
|
429 |
owner: existingUser.owner
|
430 |
});
|
431 |
}
|
|
|
432 |
const userDocument = {
|
433 |
key: newKey,
|
434 |
createdAt: new Date(),
|
|
|
269 |
|
270 |
const existingUser = await collection.findOne({ owner: userIdNumber });
|
271 |
|
272 |
+
if (!existingUser) {
|
273 |
+
return res.status(404).json({ error: "API key not found" });
|
274 |
+
}
|
275 |
+
|
276 |
if (existingUser) {
|
277 |
return res.status(200).json({
|
278 |
is_banned: existingUser.is_banned || false
|
279 |
});
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
282 |
const newKey = generateAkenoKey();
|
283 |
|
284 |
const result = await collection.updateOne(
|
|
|
429 |
owner: existingUser.owner
|
430 |
});
|
431 |
}
|
432 |
+
|
433 |
const userDocument = {
|
434 |
key: newKey,
|
435 |
createdAt: new Date(),
|