Update src/main/java/de/scimeda/keycloak/events/logging/LastLoginEventListenerProvider.java

This commit is contained in:
Thore 2021-02-23 02:03:29 +01:00 committed by GitHub
parent b0671c4d4c
commit 44aa04c7ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,9 +39,9 @@ public class LastLoginEventListenerProvider implements EventListenerProvider {
Map<String, List<String>> userAttrs = user.getAttributes();
if (userAttrs.containsKey("last-login")) {
String userLastLogin = userAttrs.get("last-login").get(0);
List<String> userLastLogin = userAttrs.get("last-login");
if (userLastLogin != null && !userLastLogin.isEmpty()) {
user.setSingleAttribute("prior-login", userLastLogin);
user.setSingleAttribute("prior-login", userLastLogin.get(0);
}
}
@ -62,4 +62,4 @@ public class LastLoginEventListenerProvider implements EventListenerProvider {
// Nothing to close
}
}
}