Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle custom authorizer 401 in non in-process runners #1319

Merged
merged 5 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/events/http/createAuthScheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down