steinarb commented on code in PR #2861:
URL: https://github.com/apache/shiro/pull/2861#discussion_r3794187044
##########
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/AuthenticationFilterDelegate.java:
##########
@@ -101,7 +104,10 @@ public boolean preHandle(ServletRequest request,
ServletResponse response) throw
public boolean isAccessAllowed(ServletRequest request, ServletResponse
response, Object mappedValue) {
Subject subject = methods.getSubject(request, response);
boolean isAuthenticated = subject.isAuthenticated() &&
subject.getPrincipal() != null;
- return isAuthenticated || (useRemembered && subject.isRemembered());
+ return isAuthenticated || (useRemembered && subject.isRemembered())
Review Comment:
For logic like this, it would be nice to have a unit test targeting this
code and triggering the NPE when the fix is not in place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]