From a7fc340c3644f8bbea36918539a924f77975804f Mon Sep 17 00:00:00 2001 From: Savindu Dimal Date: Thu, 14 Sep 2023 12:42:23 +0530 Subject: [PATCH] Fix loginRequestPath --- .../distribution/product/src/main/extensions/basicauth.jsp | 4 +++- modules/distribution/product/src/main/extensions/login.jsp | 6 +++++- .../repository/conf/tomcat/carbon/WEB-INF/web.xml.j2 | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/distribution/product/src/main/extensions/basicauth.jsp b/modules/distribution/product/src/main/extensions/basicauth.jsp index 5d801ec01b..66b3647813 100644 --- a/modules/distribution/product/src/main/extensions/basicauth.jsp +++ b/modules/distribution/product/src/main/extensions/basicauth.jsp @@ -93,14 +93,16 @@ if (userName.value) { let contextPath = "<%=proxyContextPath%>" + let loginRequestPath = "<%=loginContextRequestUrl%>" if (contextPath !== "") { contextPath = contextPath.startsWith('/') ? contextPath : "/" + contextPath contextPath = contextPath.endsWith('/') ? contextPath.substring(0, contextPath.length - 1) : contextPath + loginRequestPath = loginRequestPath.startsWith('../') ? loginRequestPath.substring(2, loginRequestPath.length) : loginRequestPath } $.ajax({ type: "GET", - url: contextPath + "<%=loginContextRequestUrl%>", + url: contextPath + loginRequestPath, xhrFields: { withCredentials: true }, success: function (data) { if (data && data.status == 'redirect' && data.redirectUrl && data.redirectUrl.length > 0) { diff --git a/modules/distribution/product/src/main/extensions/login.jsp b/modules/distribution/product/src/main/extensions/login.jsp index b9523b1ac1..594bfa9bf9 100644 --- a/modules/distribution/product/src/main/extensions/login.jsp +++ b/modules/distribution/product/src/main/extensions/login.jsp @@ -501,9 +501,13 @@