Protected View not in menue although user has the right role

Hi,

i’m trying to use waffle for sso on a project. The Login works and the User-Roles are present in the frontend. I can print them on the site via state.user.authoroties.

When i set rolesAllowed to a role the user has on a View it disappers from the autogenerated menu. I can still access it via the url and i don’t need to login. If i set it to an role the user has not it’s still missing in the menu and when i open the url i’m redirected to login.

Here is my example repository: GitHub - fastcrash/hilla-waffle-test

Can anybody point me in the right direction?

Might be related to this Update login examples to reload the page · Issue #2068 · vaadin/hilla · GitHub - did you reload after successful authentication?

Hi,

I found the solution myself. After adding this line in my SecurityConfig everything works as expected:

http.sessionManagement(sessionManagement -> sessionManagement.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED))