From ae9620a23472f38726aec669b5ba8a837a719782 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 10 Oct 2024 15:48:25 +0100 Subject: [PATCH] LPD-28319 Simplify --- .../portal/servlet/filters/secure/BaseAuthFilter.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/portal-impl/src/com/liferay/portal/servlet/filters/secure/BaseAuthFilter.java b/portal-impl/src/com/liferay/portal/servlet/filters/secure/BaseAuthFilter.java index c6e7cbc27ec601..0b9e6b45eb962d 100644 --- a/portal-impl/src/com/liferay/portal/servlet/filters/secure/BaseAuthFilter.java +++ b/portal-impl/src/com/liferay/portal/servlet/filters/secure/BaseAuthFilter.java @@ -34,6 +34,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashSet; +import java.util.Objects; import java.util.Set; import javax.servlet.FilterChain; @@ -373,12 +374,10 @@ private boolean _isDigestModified(HttpSession httpSession) return false; } - String digest = (String)httpSession.getAttribute( - WebKeys.USER_DIGEST); - user = UserLocalServiceUtil.getUser(user.getUserId()); - return !StringUtil.equals(digest, user.getDigest()); + return !Objects.equals( + user.getDigest(), httpSession.getAttribute(WebKeys.USER_DIGEST)); } private static final Log _log = LogFactoryUtil.getLog(BaseAuthFilter.class);