Skip to content

Commit

Permalink
The /secure login form now uses a hostname independent URL
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jul 17, 2019
1 parent be2f00c commit 6e506bb
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -19,17 +19,20 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.helger.commons.url.SimpleURL;
import com.helger.html.hc.IHCNode;
import com.helger.html.hc.html.grouping.HCDiv;
import com.helger.html.hc.html.textlevel.HCSmall;
import com.helger.html.hc.impl.HCNodeList;
import com.helger.phoss.smp.app.CSMP;
import com.helger.phoss.smp.ui.pub.SMPRendererPublic;
import com.helger.photon.bootstrap4.CBootstrapCSS;
import com.helger.photon.bootstrap4.form.BootstrapForm;
import com.helger.photon.bootstrap4.uictrls.ext.BootstrapLoginHTMLProvider;
import com.helger.photon.bootstrap4.utils.BootstrapPageHeader;
import com.helger.photon.core.execcontext.ISimpleWebExecutionContext;
import com.helger.security.authentication.credentials.ICredentialValidationResult;
import com.helger.servlet.request.RequestHelper;

/**
* The login screen HTML provider.
Expand All @@ -45,6 +48,13 @@ public SMPLoginHTMLProvider (final boolean bLoginError,
super (bLoginError, aLoginResult, aPageTitle);
}

@Override
protected void onBeforeForm (@Nonnull final ISimpleWebExecutionContext aSWEC, @Nonnull final BootstrapForm aForm)
{
// Change the URL to relative (fixed in ph-oton 8.2.1)
aForm.setAction (new SimpleURL (RequestHelper.getURI (aSWEC.getRequestScope ().getRequest ())));
}

@Override
@Nonnull
protected IHCNode createPageHeader (@Nonnull final ISimpleWebExecutionContext aSWEC,
Expand Down

0 comments on commit 6e506bb

Please sign in to comment.