ARTEMIS-3567 Fix IllegalStateException on web console logout

This commit is contained in:
Domenico Francesco Bruscino 2021-11-11 11:24:19 +01:00 committed by Bruscino Domenico Francesco
parent 46e28136c3
commit 8635eb65eb
1 changed files with 5 additions and 2 deletions

View File

@ -45,8 +45,11 @@ public class AuthenticationFilter implements Filter {
int status = ((Response) servletResponse).getStatus();
//status 200 means that the user has been authenticated, anything else must be a failure
if (status == 200) {
HttpSession session = ((Request) servletRequest).getSession();
AuditLogger.userSuccesfullyAuthenticatedInAudit(session != null ? (Subject) session.getAttribute("subject") : null);
//the hawtio logout servlet cleans the session and redirects to the login servlet
HttpSession session = ((Request) servletRequest).getSession(false);
if (session != null) {
AuditLogger.userSuccesfullyAuthenticatedInAudit(session != null ? (Subject) session.getAttribute("subject") : null);
}
} else {
AuditLogger.userFailedAuthenticationInAudit("" + status);
}