Skip to content

Commit

Permalink
Fix missing userId in LOGIN_ERROR event for permanent lockout with se…
Browse files Browse the repository at this point in the history
…parate username/password forms

Signed-off-by: Alaa <[email protected]>
  • Loading branch information
Alaa authored and mposolda committed Dec 12, 2024
1 parent bbca611 commit 6f469b9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,10 @@ public Response finishAuthentication(LoginProtocol protocol) {

public void validateUser(UserModel authenticatedUser) {
if (authenticatedUser == null) return;
if (!authenticatedUser.isEnabled()) throw new AuthenticationFlowException(AuthenticationFlowError.USER_DISABLED);
if (!authenticatedUser.isEnabled()) {
event.user(authenticatedUser).detail(Details.USERNAME, authenticatedUser.getUsername());
throw new AuthenticationFlowException(AuthenticationFlowError.USER_DISABLED);
}
if (authenticatedUser.getServiceAccountClientLink() != null) throw new AuthenticationFlowException(AuthenticationFlowError.UNKNOWN_USER);
}

Expand Down

0 comments on commit 6f469b9

Please sign in to comment.