File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,15 @@ export const withProtectedRoutesHandler = (
7
7
) : void => {
8
8
const { rootPath } = admin . options ;
9
9
10
- fastifyApp . addHook ( 'preHandler' , async ( request , reply ) => {
11
- const buildComponentRoute = AdminRouter . routes . find ( ( r ) => r . action === 'bundleComponents' ) ?. path
12
- if ( AdminRouter . assets . find ( ( asset ) => request . url . match ( asset . path ) ) ) {
10
+ fastifyApp . addHook ( "preHandler" , async ( request , reply ) => {
11
+ const buildComponentRoute = AdminRouter . routes . find (
12
+ ( r ) => r . action === "bundleComponents"
13
+ ) ?. path ;
14
+ const assets = [
15
+ ...AdminRouter . assets . map ( ( a ) => a . path ) ,
16
+ ...Object . values ( admin . options ?. assets ?? { } ) . flat ( ) ,
17
+ ] ;
18
+ if ( assets . find ( ( a ) => request . url . match ( a ) ) ) {
13
19
return ;
14
20
} else if ( buildComponentRoute && request . url . match ( buildComponentRoute ) ) {
15
21
return ;
You can’t perform that action at this time.
0 commit comments