I have 2 functions(authenticate, restrictAccess) in the before hook (get) and i want to chain them together.But the restrictAccess is being executed twice(by the second round it has lost the context) When i remove the authenticate , the restrictAccess works as expected.
Here is my hook
module.exports = {
before: {
all: [],
get: [authenticate('jwt'), restrictAccess()],
....
But when i remove authenticate as this
module.exports = {
before: {
all: [],
get: [ restrictAccess()],
....
restrictAccess works as expected