Skip to content

Commit

Permalink
Avoid Fastify deprecation warning for request.routerPath (#141)
Browse files Browse the repository at this point in the history
1.3.9
  • Loading branch information
kennsippell authored Apr 17, 2024
1 parent e82ac93 commit b65141e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cht-user-management",
"version": "1.3.8",
"version": "1.3.9",
"main": "dist/index.js",
"dependencies": {
"@fastify/autoload": "^5.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const build = (opts: FastifyServerOptions): FastifyInstance => {
Auth.assertEnvironmentSetup();

fastify.addHook('preValidation', async (req: FastifyRequest, reply: FastifyReply) => {
if (req.unauthenticated || req.routerPath === '/public/*') {
if (req.unauthenticated || req.routeOptions.url === '/public/*') {
return;
}

Expand Down

0 comments on commit b65141e

Please sign in to comment.