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

Server-side access control is not updated when a new view is added #2884

Open
Legioth opened this issue Oct 31, 2024 · 3 comments
Open

Server-side access control is not updated when a new view is added #2884

Legioth opened this issue Oct 31, 2024 · 3 comments
Labels
bug Something isn't working hilla Issues related to Hilla Impact: High Severity: Minor

Comments

@Legioth
Copy link
Member

Legioth commented Oct 31, 2024

Describe the bug

In an application with access control (from start.vaadin.com), the server-side access control rules are not applied immediately when a new view is added. This leads to being redirected to /login if you try to navigate to a recently added public view if you are not logged in. The view can be accessed without being logged in after restarting the server.

Expected-behavior

Expected that the server-side access control settings are updated immediately when a new view is added.

Reproduction

  1. Create an application on start.vaadin.com with access control for a /foo view and no access control for a/bar view.
  2. Launch in dev mode
  3. Copy views/bar.tsx into views/baz.tsx
  4. Navigate to the new view from the new menu entry
  5. Reload the page and observe that you're redirected to the login page.
  6. Restart the server
  7. Repeat steps 4 and 5 and observe that the view is still rendered after the reload

System Info

Vaadin 24.5.2

@Legioth Legioth added bug Something isn't working hilla Issues related to Hilla labels Oct 31, 2024
@platosha
Copy link
Contributor

platosha commented Nov 5, 2024

Probably worked in 24.4 by triggering a redeploy.

@platosha
Copy link
Contributor

platosha commented Nov 5, 2024

The key is getting RouteUtil.isRouteAllowed() behavior right.

@platosha
Copy link
Contributor

platosha commented Nov 5, 2024

An easy solution could be reading the json every time in dev mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla Impact: High Severity: Minor
Projects
None yet
Development

No branches or pull requests

2 participants