Skip to content

Commit

Permalink
Remove debug comment
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvullings committed Jul 30, 2021
1 parent db1e4d0 commit 86d49ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const pdp = (ctx: Koa.Context): boolean => {
if (apiKeys.whitelist.length > 0) {
// console.table(apiKeys);
const hostname = ctx.hostname && ctx.hostname.toUpperCase();
// console.table(hostname);
console.log(hostname);
if (hostname && apiKeys.whitelist.includes(hostname)) {
return true;
}
Expand All @@ -95,7 +95,9 @@ const pdp = (ctx: Koa.Context): boolean => {

/** Simple Policy Enforcement Point */
export const pep = async (ctx: Koa.Context, next: () => Promise<any>) => {
if (pdp(ctx)) {
const allowed = pdp(ctx);
// console.log('Allowed: ' + allowed);
if (allowed) {
// Use await next. See here: https://github.com/ZijianHe/koa-router/issues/358
await next();
}
Expand Down

0 comments on commit 86d49ce

Please sign in to comment.