File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,9 +7,15 @@ export const withProtectedRoutesHandler = (
77) : void => {
88 const { rootPath } = admin . options ;
99
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 ) ) ) {
1319 return ;
1420 } else if ( buildComponentRoute && request . url . match ( buildComponentRoute ) ) {
1521 return ;
You can’t perform that action at this time.
0 commit comments