Skip to content

Commit

Permalink
refactor: use function statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 16, 2022
1 parent 48ee32f commit d213921
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/events/http/authJWTSettingsExtractor.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { log } from '@serverless/utils/log.js'

function buildFailureResult(warningMessage) {
log.warning(warningMessage)

return {
unsupportedAuth: true,
}
}

function buildSuccessResult(authorizerName) {
return {
authorizerName,
}
}

export default function authJWTSettingsExtractor(
endpoint,
provider,
ignoreJWTSignature,
) {
const buildFailureResult = (warningMessage) => {
log.warning(warningMessage)

return {
unsupportedAuth: true,
}
}

const buildSuccessResult = (authorizerName) => ({ authorizerName })

const { authorizer } = endpoint

if (!authorizer) {
Expand Down

0 comments on commit d213921

Please sign in to comment.