diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java index d5390c9fc5..c09bbc8b98 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java @@ -316,7 +316,8 @@ public final class ComponentConfig { WebappInfo webappInfo = null; List webappsInfo = getAppBarWebInfos(serverName); for(WebappInfo currApp : webappsInfo) { - if (webAppName.equals(currApp.getName())) { + String currWebAppName = currApp.getMountPoint().replace("/", "").replace("*", ""); + if (webAppName.equals(currWebAppName)) { webappInfo = currApp; break; } @@ -944,6 +945,10 @@ public final class ComponentConfig { return name; } + public String getMountPoint() { + return mountPoint; + } + public String getTitle() { return title; } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ExternalLoginKeysManager.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ExternalLoginKeysManager.java index c5fd518f63..1ffb9650fc 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ExternalLoginKeysManager.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ExternalLoginKeysManager.java @@ -157,7 +157,8 @@ public class ExternalLoginKeysManager { GenericValue currentUserLogin = (GenericValue) session.getAttribute("userLogin"); if (currentUserLogin != null) { if (currentUserLogin.getString("userLoginId").equals(userLogin.getString("userLoginId"))) { - // is the same user, just carry on... + // same user, just make sure the autoUserLogin is set to the same and that the client cookie has the correct userLoginId + LoginWorker.autoLoginSet(request, response); return "success"; } @@ -171,6 +172,9 @@ public class ExternalLoginKeysManager { Debug.logWarning("Could not find userLogin for external login key: " + externalKey, module); } + // make sure the autoUserLogin is set to the same and that the client cookie has the correct userLoginId + LoginWorker.autoLoginSet(request, response); + return "success"; }