package ch.difty.sipamato;

import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;

public class LoginPage extends BasePage {

    private static final long serialVersionUID = 1L;

    public LoginPage(PageParameters parameters) {
        super(parameters);
    }

    @Override
    protected void onInitialize() {
        super.onInitialize();

        if (((AbstractAuthenticatedWebSession) getSession()).isSignedIn()) {
            continueToOriginalDestination();
        }

        add(new LoginForm("form"));
    }

    private static class LoginForm extends Form<LoginForm> {
        private static final long serialVersionUID = 1L;

        private String username;
        private String password;

        public LoginForm(String id) {
            super(id);
            setModel(new CompoundPropertyModel<>(this));

            add(new Label("usernameLabel", new ResourceModel("username.label", "un")));
            add(new RequiredTextField<String>("username"));
            add(new Label("passwordLabel", new ResourceModel("password.label", "pw")));
            add(new PasswordTextField("password"));
        }

        @Override
        protected void onSubmit() {
            AuthenticatedWebSession session = AuthenticatedWebSession.get();
            if (session.signIn(username, password)) {
                setResponsePage(SipamatoHomePage.class);
            } else {
                error(getString("msg.login.failure"));
            }
        }
    }
}

@@ -1000,24 +1000,63 @@
 %22));%0A    %7D%0A%0A
+    // TODO consider using SignInPanel%0A
     private 
@@ -1305,16 +1305,23 @@
      set
+Default
 Model(ne

Add todo in LoginPage