From 81d2edc33d0108f1f33de85982d337fb04962bd7 Mon Sep 17 00:00:00 2001 From: Huseyin ELMAS Date: Sun, 22 Dec 2024 14:57:39 +0300 Subject: [PATCH] chore: cleanup --- example.js | 2 +- package.json | 2 +- src/index.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example.js b/example.js index 71029a7..f230b65 100644 --- a/example.js +++ b/example.js @@ -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', diff --git a/package.json b/package.json index 51572c7..28fdc9e 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/index.js b/src/index.js index 47687f2..4e39fc7 100644 --- a/src/index.js +++ b/src/index.js @@ -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) => {