diff --git a/src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java b/src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java index d3756c67..c72e3e2e 100644 --- a/src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java +++ b/src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java @@ -91,6 +91,10 @@ private ReportPortalUser acquireUser(Authentication authentication) { ErrorType.USER_NOT_FOUND, rpAuth.getPrincipal() )); } else { + if (!((ReportPortalUser) authentication.getPrincipal()).isEnabled()) { + SecurityContextHolder.clearContext(); + throw new LockedException("User account is locked"); + } return (ReportPortalUser) authentication.getPrincipal(); } }