Skip to content

Commit

Permalink
Debugging log statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Oct 1, 2024
1 parent c3c7477 commit 78154fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export async function apiKeyMiddleware(req: Request, res: ExpressResponse, next:
const key = req.get("Authorization");
const apiKey = key ? await getAPIKey(key) : null;
const apiKeyExists = apiKey !== null;
console.log(`key is null: ${key === null}`);
console.log(`key is undefined: ${key === undefined}`);
console.log(`API key exists: ${apiKeyExists}`);
if (validOrigin || (apiKeyExists && hasPermission(apiKey, req))) {
next();
} else {
Expand Down

0 comments on commit 78154fb

Please sign in to comment.