title: Best approach to handle login and authorizations in Vaadin Flow?
body: <p>I'm using Vaadin Flow to develop a web app with Java. I would like to know the best way to handle login and authorization. I've been giving this a thought and I'm not sure the best way to do this.</p>
  <p>I have a login view and a main app view with a content holder for nested layouts.</p>
  <p>How do I check that the user is logged in and what permissions does it have to see or not see some part of the app? I've read about BeforeEnterEvent and ReRouting but it's still not very clear.</p>
  <ul>
  <li><p>Do I have to use BeforeEnterEvent for each class I have? Do I have to create a class with user parameters like a boolean to check if it's logged in and a string for the kind of authorization it has? And where do I create or save this instance?</p>
  </li>
  <li><p>Is there a simple way to do this? Like to start with an empty layout and to start that with the login screen, then the login screen decides to swap for the main app view? And how do I prevent the user to type the address of the main view in the bar and access parts it shouldn't access like: /app/adminsettings</p>
  </li>
  </ul>
  <p>I'm sure this is way simpler but I think I have my head overloaded by now, thanks anyone in advance!</p>