Skip to content

Commit

Permalink
wip: Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Jan 18, 2024
1 parent c8f0464 commit 742ee9e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api.planx.uk/modules/ordnanceSurvey/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ const checkAllowedOrigins: CorsOptions["origin"] = (origin, callback) => {
const isAllowed =
origin && MAP_ALLOWLIST.some((pattern) => pattern.test(origin));

console.log("***************");
console.log("***************");
console.log("***************");
console.log({ origin });
console.log({ isAllowed });
console.log("***************");
console.log("***************");
console.log("***************");

!origin || isAllowed
? callback(null, true)
: callback(new ServerError({ status: 401, message: "Unauthorised" }));
Expand Down

0 comments on commit 742ee9e

Please sign in to comment.