diff --git a/src/events/http/createAuthScheme.js b/src/events/http/createAuthScheme.js index 23a1f3c5b..761f33510 100644 --- a/src/events/http/createAuthScheme.js +++ b/src/events/http/createAuthScheme.js @@ -125,7 +125,7 @@ export default function createAuthScheme( try { const result = await lambdaFunction.runHandler() - + if (result === 'Unauthorized') return Boom.unauthorized('Unauthorized') // return processResponse(null, result) const policy = result diff --git a/src/lambda/handler-runner/in-process-runner/InProcessRunner.js b/src/lambda/handler-runner/in-process-runner/InProcessRunner.js index 9bcd556f8..2ba503ee3 100644 --- a/src/lambda/handler-runner/in-process-runner/InProcessRunner.js +++ b/src/lambda/handler-runner/in-process-runner/InProcessRunner.js @@ -115,8 +115,13 @@ export default class InProcessRunner { const callbackCalled = new Promise((resolve, reject) => { callback = (err, data) => { + if (err === 'Unauthorized') { + resolve('Unauthorized') + return + } if (err) { reject(err) + return } resolve(data) }