Skip to content

Commit

Permalink
refactor: use named import
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed May 31, 2022
1 parent 2cf6b41 commit 669ebc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/ServerlessOffline.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
defaultOptions,
SERVER_SHUTDOWN_TIMEOUT,
} from './config/index.js'
// import pkg from '../package.json'

const require = createRequire(import.meta.url)
const pkg = require('../package.json')
Expand Down
4 changes: 2 additions & 2 deletions src/events/http/createJWTAuthScheme.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Boom from '@hapi/boom'
import jwt from 'jsonwebtoken'
import { decode } from 'jsonwebtoken'
import serverlessLog from '../../serverlessLog.js'

const { isArray } = Array
Expand Down Expand Up @@ -45,7 +45,7 @@ export default function createAuthScheme(jwtOptions, { log }) {
}

try {
const decoded = jwt.decode(jwtToken, { complete: true })
const decoded = decode(jwtToken, { complete: true })
if (!decoded) {
return Boom.unauthorized('JWT not decoded')
}
Expand Down

0 comments on commit 669ebc6

Please sign in to comment.