Fail to create a login page with vaadin-login-flow

Hi,
I’m trying to create a login page using vaadin-login-flow in my spring boot project but as a result I get a blank page :frowning:
This is my View page (copied from example : https://vaadin.com/components/vaadin-login/java-examples) :

@Route("")
//@PWA(name = "HMS-Login", shortName = "Login")
public class MainView extends VerticalLayout {
    public MainView() {
        LoginOverlay component = new LoginOverlay();
        component.addLoginListener(e -> component.close());
        Button open = new Button("Open login overlay",
                e -> component.setOpened(true));

        LoginI18n i18n = LoginI18n.createDefault();
        i18n.setAdditionalInformation("To close the login form submit non-empty username and password");
        component.setI18n(i18n);
        add(component);

    }
}

Please help

Hi Alexander. I think your issue is that you’re only adding the closed login overlay component to the view, but not the button that opens the overlay. So if you add add(open) you will get the button visible.

Thanks a lot it helped