Skip to content

Commit 411e2a2

Browse files
authored
fix: fix issue with Authentication not leading to login page (#15)
* Fix issue with Authentication not leading to login page Issue is outlined in #13 * fix: add missing parentheses * Update protected-routes.handler.ts Fixes Typescript error for optional `Object`
1 parent 917db73 commit 411e2a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/authentication/protected-routes.handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ export const withProtectedRoutesHandler = (
88
const { rootPath } = admin.options;
99

1010
fastifyApp.addHook('preHandler', async (request, reply) => {
11+
const buildComponentRoute = AdminRouter.routes.find((r) => r.action === 'bundleComponents')?.path
1112
if (AdminRouter.assets.find((asset) => request.url.match(asset.path))) {
1213
return;
13-
} else if (AdminRouter.routes.find((r) => r.action === 'bundleComponents')) {
14+
} else if (buildComponentRoute && request.url.match(buildComponentRoute)) {
1415
return;
1516
} else if (
1617
!request.url.startsWith(rootPath) ||

0 commit comments

Comments
 (0)