Skip to content

Commit

Permalink
Replace decorateRequest by onRequest hook
Browse files Browse the repository at this point in the history
  • Loading branch information
andreffvalente committed Aug 5, 2024
1 parent b1b4727 commit ef39bc9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ const plugin = async (fastify, options) => {
});

// Decorate request.
fastify.decorateRequest(DECORATOR_NAME, {
operation: {},
security: {},
securityReport: []
fastify.addHook('onRequest', async (request) => {

Check failure on line 44 in src/plugin.js

View workflow job for this annotation

GitHub Actions / tests

Replace `(request)` with `request`
request[DECORATOR_NAME] = {
operation: {},
security: {},
securityReport: []
};
});
};

Expand Down

0 comments on commit ef39bc9

Please sign in to comment.