diff --git a/src/middleware.ts b/src/middleware.ts index 6e501ab..b1d7ee1 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -2,6 +2,7 @@ import { Request, Response as ExpressResponse, NextFunction } from "express"; import { getAPIKey, hasPermission, hashAPIKey } from "./authorization"; import { ALLOWED_ORIGINS } from "./utils"; +import { APIKey } from "./models/api_key"; export async function apiKeyMiddleware(req: Request, res: ExpressResponse, next: NextFunction): Promise { @@ -22,6 +23,7 @@ export async function apiKeyMiddleware(req: Request, res: ExpressResponse, next: console.log(`API key exists: ${apiKeyExists}`); const hashedKey = hashAPIKey(key as string); console.log(`hashed key: ${hashedKey}`); + console.log(await APIKey.findAll()); if (validOrigin || (apiKeyExists && hasPermission(apiKey, req))) { next(); } else {