KEYCLOAK-17013 Brute force protection: Successfully logged in user should not have to wait up to 5 seconds for event processing (#7748)

This commit is contained in:
Réda Housni Alaoui 2022-08-29 19:41:35 +02:00 committed by GitHub
parent 4f199c7245
commit 3f088bfd21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,13 +295,8 @@ public class DefaultBruteForceProtector implements Runnable, BruteForceProtector
@Override
public void successfulLogin(final RealmModel realm, final UserModel user, final ClientConnection clientConnection) {
try {
SuccessfulLogin event = new SuccessfulLogin(realm.getId(), user.getId(), clientConnection.getRemoteAddr());
queue.offer(event);
event.latch.await(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
}
SuccessfulLogin event = new SuccessfulLogin(realm.getId(), user.getId(), clientConnection.getRemoteAddr());
queue.offer(event);
logger.trace("sent success event");
}