How to disable login for a Hilla view

I have a Vaadin app that is primarily in Flow and requires login. However, it has one public Hilla page that should be accessible without logging in. I had to make a custom routes.tsx to configure the Hilla route outside the Flow main layout, here’s what I have:

export const {router, routes} = new RouterConfigurationBuilder()
  .withReactRoutes([
    {
      path: '/a/:token',
      element: <SurveyAnswer/>
    }
  ])
  .withFallback(Flow)
  .protect()
  .build();

In the view, I have:

export const config: ViewConfig = {
  loginRequired: false
}

Yet, navigating to the view requires login. How do I allow anonymous users to access the view?

Probably it’s the Flow layout that doesn’t allow you to access this route.

Could you try adding @AnonymousAllowed to the Flow layout ?

The reason I made this workaround is to show the Hilla view outside the Flow layout. The Flow layout is part of the admin app and should not be @AnonymousAllowed

If you want to not use Flow layout for this Hilla view, the ViewConfig.flowLayout=false is probably what you want, could you try it?

Thanks, I’ll try that. I didn’t find that option earlier.