Skip to content

Commit

Permalink
Read state parameter and apply layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ramindu90 committed Aug 11, 2023
1 parent bc18972 commit 21ffb3e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions includes/layout-resolver.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.net.URLDecoder" %>

<%-- Change the layout name to activate another layout --%>
<%
Expand All @@ -28,9 +29,13 @@
<%
String relyingParty = request.getParameter("relyingParty");
String tenantDomain1 = request.getParameter("tenantDomain");
if (config.getServletContext().getResource("extensions/layouts/"+tenantDomain1+"/body.ser") != null) {
layout = tenantDomain1;
String callingTenant = tenantDomain1;
if (tenantDomain1.equals("carbon.super")) {
String[] stateValues = URLDecoder.decode(request.getParameter("state"), "UTF-8").split("=");
callingTenant = stateValues[1];
}
if (config.getServletContext().getResource("extensions/layouts/"+callingTenant+"/body.ser") != null) {
layout = callingTenant;
}
%>

Expand Down

0 comments on commit 21ffb3e

Please sign in to comment.