File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const jwt = fastifyPlugin(
28
28
fastify . addHook ( 'preHandler' , async ( request , reply ) => {
29
29
request . jwt = ( request . headers . authorization || '' ) . replace ( BEARER , '' )
30
30
31
- if ( ! request . jwt && request . routeConfig . allowInvalidJwt ) {
31
+ if ( ! request . jwt && request . routeOptions . config . allowInvalidJwt ) {
32
32
request . jwtPayload = { role : 'anon' }
33
33
request . isAuthenticated = false
34
34
return
@@ -45,7 +45,7 @@ export const jwt = fastifyPlugin(
45
45
request . jwtPayload = { role : 'anon' }
46
46
request . isAuthenticated = false
47
47
48
- if ( request . routeConfig . allowInvalidJwt ) {
48
+ if ( request . routeOptions . config . allowInvalidJwt ) {
49
49
return
50
50
}
51
51
throw ERRORS . AccessDenied ( err . message , err )
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export const logRequest = (options: RequestLoggerOptions) =>
59
59
const resourceFromParams = Object . values ( req . params || { } ) . join ( '/' )
60
60
const resources = getFirstDefined < string [ ] > (
61
61
req . resources ,
62
- req . routeConfig . resources ?.( req ) ,
62
+ req . routeOptions . config . resources ?.( req ) ,
63
63
( req . raw as any ) . resources ,
64
64
resourceFromParams ? [ resourceFromParams ] : ( [ ] as string [ ] )
65
65
)
@@ -73,7 +73,7 @@ export const logRequest = (options: RequestLoggerOptions) =>
73
73
}
74
74
75
75
req . resources = resources
76
- req . operation = req . routeConfig . operation
76
+ req . operation = req . routeOptions . config . operation
77
77
78
78
if ( req . operation ) {
79
79
trace . getActiveSpan ( ) ?. setAttribute ( 'http.operation' , req . operation . type )
@@ -129,7 +129,7 @@ function doRequestLog(req: FastifyRequest, options: LogRequestOptions) {
129
129
owner : req . owner ,
130
130
role : req . jwtPayload ?. role ,
131
131
resources : req . resources ,
132
- operation : req . operation ?. type ?? req . routeConfig . operation ?. type ,
132
+ operation : req . operation ?. type ?? req . routeOptions . config . operation ?. type ,
133
133
serverTimes : req . serverTimings ,
134
134
} )
135
135
}
You can’t perform that action at this time.
0 commit comments