Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication is broken in v4.0.0 #13

Open
makuko opened this issue Apr 23, 2023 · 1 comment
Open

Authentication is broken in v4.0.0 #13

makuko opened this issue Apr 23, 2023 · 1 comment

Comments

@makuko
Copy link

makuko commented Apr 23, 2023

In the latest commit in protected-routes.handler.ts the following else if block was introduced:

} else if (AdminRouter.routes.find((r) => r.action === 'bundleComponents')) {
      return;

It breaks authentication and AdminJS is accessible without login. After removing it everything works as expected again. A minimal installation following the docs is enough to reproduce the issue.

@makuko
Copy link
Author

makuko commented Apr 23, 2023

I did some further investigation. The condition AdminRouter.routes.find((r) => r.action === 'bundleComponents') will always be true because the route always exists. It should be changed to
request.url.match(AdminRouter.routes.find((r) => r.action === 'bundleComponents').path) to only be true when the bundle is requested.

camanjj added a commit to camanjj/adminjs-fastify that referenced this issue Jun 5, 2023
dziraf pushed a commit that referenced this issue Jun 30, 2023
* 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`
github-actions bot pushed a commit that referenced this issue Jun 30, 2023
## [4.0.1](v4.0.0...v4.0.1) (2023-06-30)

### Bug Fixes

* fix issue with Authentication not leading to login page ([#15](#15)) ([411e2a2](411e2a2)), closes [#13](#13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant