randydev commited on
Commit
6a528c7
·
verified ·
1 Parent(s): b9b40d5

Update middleware/midware.js

Browse files
Files changed (1) hide show
  1. 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, type: "premium" });
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
  }