"Applied fix from trunk for revision: 1851350"

------------------------------------------------------------------------
r1851350 | jleroux | 2019-01-15 14:48:33 +0100 (mar. 15 janv. 2019) | 7 lignes

Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)

As reported by Deepak Nigam on dev ML there was a risk of NPE with userLogin w/
my last commit at r1851074  

Thanks Deepak for the report and proposed fix
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851351 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2019-01-15 13:48:56 +00:00
parent abfa515747
commit 6b162efacc
@@ -927,8 +927,8 @@ public class LoginWorker {
WebappInfo webappInfo = ComponentConfig.getWebappInfo((String) context.getAttribute("_serverId"), applicationName);
if (userLogin != null &&
(webappInfo != null && webappInfo.isAutologinCookieUsed())
|| webappInfo == null) { // When using an empty mounpoint, ie using root as mounpoint. Beware: works only for 1 webapp!
((webappInfo != null && webappInfo.isAutologinCookieUsed())
|| webappInfo == null)) { // When using an empty mountpoint, ie using root as mountpoint. Beware: works only for 1 webapp!
Cookie autoLoginCookie = new Cookie(getAutoLoginCookieName(request), userLogin.getString("userLoginId"));
autoLoginCookie.setMaxAge(60 * 60 * 24 * 365);
autoLoginCookie.setDomain(EntityUtilProperties.getPropertyValue("url", "cookie.domain", delegator));