Update middleware/midware.js
Browse files- middleware/midware.js +2 -2
middleware/midware.js
CHANGED
@@ -12,8 +12,8 @@ const authenticateApiKeyPremium = async (req, res, next) => {
|
|
12 |
}
|
13 |
|
14 |
try {
|
15 |
-
const keyData = await ApiKey.findOne({ key: apiKey
|
16 |
-
|
17 |
if (!keyData) {
|
18 |
return res.status(403).json({ error: 'Invalid or non-premium API Key' });
|
19 |
}
|
|
|
12 |
}
|
13 |
|
14 |
try {
|
15 |
+
const keyData = await ApiKey.findOne({ key: apiKey });
|
16 |
+
console.log("test mongoose", keyData);
|
17 |
if (!keyData) {
|
18 |
return res.status(403).json({ error: 'Invalid or non-premium API Key' });
|
19 |
}
|