Skip to content

Commit

Permalink
More debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Oct 1, 2024
1 parent a585354 commit e28f156
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export async function apiKeyMiddleware(req: Request, res: ExpressResponse, next:
const host = req.headers.origin;
const validOrigin = host && ALLOWED_ORIGINS.includes(host);
const key = req.get("Authorization");
console.log(req);
const apiKey = key ? await getAPIKey(key) : null;
const apiKeyExists = apiKey !== null;
console.log(`key is null: ${key === null}`);
Expand Down
1 change: 1 addition & 0 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createConnection, Connection } from "mysql2/promise";
import { hashAPIKey } from "../src/authorization";

export function authorize(request: Test): Test {
console.log(process.env.CDS_API_KEY?.length);
return request.set({ Authorization: process.env.CDS_API_KEY });
}

Expand Down

0 comments on commit e28f156

Please sign in to comment.