Skip to content

Commit

Permalink
Update for Fastify v2
Browse files Browse the repository at this point in the history
  • Loading branch information
delvedor committed Feb 25, 2019
1 parent 5819dab commit 78adb35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ function authenticate (keys, key) {
}

function plugin (fastify, options, next) {
fastify.addHook('preHandler', factory(options))
fastify.addHook('onRequest', factory(options))
next()
}

module.exports = fp(plugin, {
fastify: '^1.0.0',
fastify: '^2.0.0',
name: 'fastify-bearer-auth'
})
module.exports.internals = { factory }

0 comments on commit 78adb35

Please sign in to comment.