Update index.js
Browse files
index.js
CHANGED
@@ -327,7 +327,6 @@ app.post('/api/v2/key/generate-key', authenticateApiKey, apiLimiter, async (req,
|
|
327 |
}
|
328 |
|
329 |
const existingUser = await ApiKey.findOne({ owner: userIdNumber });
|
330 |
-
console.log(existingUser);
|
331 |
if (existingUser) {
|
332 |
return res.status(200).json({
|
333 |
apiKey: existingUser.key,
|
@@ -340,7 +339,7 @@ app.post('/api/v2/key/generate-key', authenticateApiKey, apiLimiter, async (req,
|
|
340 |
}
|
341 |
|
342 |
const expirationDate = new Date();
|
343 |
-
expirationDate.setDate(expirationDate.getDate() +
|
344 |
|
345 |
const userDocument = new ApiKey({
|
346 |
key: newKey,
|
|
|
327 |
}
|
328 |
|
329 |
const existingUser = await ApiKey.findOne({ owner: userIdNumber });
|
|
|
330 |
if (existingUser) {
|
331 |
return res.status(200).json({
|
332 |
apiKey: existingUser.key,
|
|
|
339 |
}
|
340 |
|
341 |
const expirationDate = new Date();
|
342 |
+
expirationDate.setDate(expirationDate.getDate() + 0);
|
343 |
|
344 |
const userDocument = new ApiKey({
|
345 |
key: newKey,
|