Skip to content

Commit

Permalink
fix: fix issue with Authentication not leading to login page (#15)
Browse files Browse the repository at this point in the history
* 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`
  • Loading branch information
camanjj authored Jun 30, 2023
1 parent 917db73 commit 411e2a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/authentication/protected-routes.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ export const withProtectedRoutesHandler = (
const { rootPath } = admin.options;

fastifyApp.addHook('preHandler', async (request, reply) => {
const buildComponentRoute = AdminRouter.routes.find((r) => r.action === 'bundleComponents')?.path
if (AdminRouter.assets.find((asset) => request.url.match(asset.path))) {
return;
} else if (AdminRouter.routes.find((r) => r.action === 'bundleComponents')) {
} else if (buildComponentRoute && request.url.match(buildComponentRoute)) {
return;
} else if (
!request.url.startsWith(rootPath) ||
Expand Down

0 comments on commit 411e2a2

Please sign in to comment.