Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hsynlms committed Dec 22, 2024
1 parent 9c99f45 commit 81d2edc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const defaults = { port: 3000 }
await fastify.register(fastifyGuard)

// simulation for user authentication process
fastify.addHook('onRequest', (req, reply, done) => {
fastify.addHook('onRequest', (req, _, done) => {
req.user = {
id: 306,
name: 'Huseyin',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastify-guard",
"version": "3.0.0",
"version": "3.0.1",
"description": "A simple user role and scope checker plugin to protect endpoints for Fastify",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

const fastifyPlugin = require('fastify-plugin')
const createError = require('http-errors')

const pkg = require('../package.json')

const defaults = {
decorator: 'guard',
requestProperty: 'user',
roleProperty: 'role',
scopeProperty: 'scope',
errorHandler: undefined
scopeProperty: 'scope'
}

const checkScopeAndRole = (arr, req, options, property) => {
Expand Down

0 comments on commit 81d2edc

Please sign in to comment.