Login Overlay - add new button

Is there any possibility to add a new button to the login overlay? I need to add “Registration” button but when I do it, that button is “under” login form and when I start app then I don’t see it… I don’t have any ide how to add this button under “Log in” button. Can you help me?

My code:

@Tag("sa-login-view")
@Route(value = LibraryConst.ROUTE_LOGIN)
@PageTitle(LibraryConst.TITLE_LOGIN)
public class LoginView extends VerticalLayout {
    private LoginOverlay login = new LoginOverlay();

    @Autowired
    public LoginView(AuthenticationManager authenticationManager) {
        login.setOpened(true);
        login.setTitle(LibraryConst.TITLE_LOGIN);
        login.setVisible(false);

        Button button = new Button("Register");

        add(login, button);

        login.addLoginListener(e -> {
            try {
                final Authentication authentication = authenticationManager
                        .authenticate(new UsernamePasswordAuthenticationToken(e.getUsername(), e.getPassword()));
                if(authentication != null) {
                    login.close();
                    SecurityContextHolder.getContext().setAuthentication(authentication);
                    getUI().get().navigate("/");
                }
            } catch (AuthenticationException ex) {
                login.setError(true);
            }
        });
    }
}

I need this feature too.
It’s a bit silly to have a login form without giving the user the chance to sign-up first!!!

What an incredibly poor design by Vaadin. The Login Overlay is basically worthless without the ability to add a button for new users.

Brian Sheely:
What an incredibly poor design by Vaadin. The Login Overlay is basically worthless without the ability to add a button for new users.

Hi,
Actually, I came up with a workaround for this. I’ll give you an example and I hope it helps you too.
Login Overlay provides the developers with an Anchor option (Visible beneath the Login button) for handling the “Forgot Password” situation.
Actually, it doesn’t provide any specific feature regarding the “Forgot Password” functionality itself. it is simply an Anchor object you can point it to where ever you want.
In my application I have used this to navigate the user to Sign-Up page, out of the Login Overlay, as following.

LoginOverlay login = new LoginOverlay();
LoginI18n loginForm = LoginI18n.createDefault();
login.setI18n(loginForm);
loginForm.getForm().setForgotPassword("Forgot Password/Sign Up");
login.setForgotPasswordButtonVisible(true);
login.setAction("login");
login.addForgotPasswordListener(event -> {
      login.close();
      switchOrNavigateToView(VIEWS.SIGNUP);
});

Brian Sheely:
What an incredibly poor design by Vaadin. The Login Overlay is basically worthless without the ability to add a button for new users.

The login overlay is not designed to be for new users. If your application allows registration of new users, you could for example show two forms on the login page. The registration form you would have to build yourself. And for the login form, you can use LoginForm instead of LoginOverlay. The LoginForm is just the form, and doesn’t occupy the whole screen.