Implementing the login/logout process

Let's recap what we have implemented at this point. We have a multi-language LoginFormComponent ready for use (developed in Chapter 3, Implementing Server-Side Components with Internationalization), a UI implementation that shows a PublicComponent or a PrivateComponent, depending on whether a user is authenticated, and an AuthService class that allows us to authenticate a user (if their login credentials are correct) and check whether there is an authenticated user in the session or not.

It's time to complete the login/logout process by implementing the PublicComponent and PrivateComponent classes. Let's start with the PublicComponent class:

public class PublicComponent extends Composite { public PublicComponent() ...

Get Data-Centric Applications with Vaadin 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.