Update middleware/midware.js
Browse files- middleware/midware.js +0 -8
middleware/midware.js
CHANGED
@@ -13,10 +13,6 @@ const authenticateApiKeyPremium = async (req, res, next) => {
|
|
13 |
}
|
14 |
|
15 |
try {
|
16 |
-
const validApiKeys = ['randydev'];
|
17 |
-
if (validApiKeys.includes(apiKey)) {
|
18 |
-
next();
|
19 |
-
}
|
20 |
const keyData = await ApiKey.findOne({ key: apiKey });
|
21 |
if (!keyData) {
|
22 |
return res.status(403).json({ error: 'Invalid or non-premium API Key' });
|
@@ -41,10 +37,6 @@ const authenticateApiKey = async (req, res, next) => {
|
|
41 |
}
|
42 |
|
43 |
try {
|
44 |
-
const validApiKeys = ['randydev'];
|
45 |
-
if (validApiKeys.includes(apiKey)) {
|
46 |
-
next();
|
47 |
-
}
|
48 |
const keyDoc = await db.findOne({key: apiKey});
|
49 |
if (!keyDoc) {
|
50 |
return res.status(403).json({ error: 'Invalid API Key' });
|
|
|
13 |
}
|
14 |
|
15 |
try {
|
|
|
|
|
|
|
|
|
16 |
const keyData = await ApiKey.findOne({ key: apiKey });
|
17 |
if (!keyData) {
|
18 |
return res.status(403).json({ error: 'Invalid or non-premium API Key' });
|
|
|
37 |
}
|
38 |
|
39 |
try {
|
|
|
|
|
|
|
|
|
40 |
const keyDoc = await db.findOne({key: apiKey});
|
41 |
if (!keyDoc) {
|
42 |
return res.status(403).json({ error: 'Invalid API Key' });
|