From aece5d1b4cb27bf7fa6a70c54f759d9f7e4fe709 Mon Sep 17 00:00:00 2001 From: stianst Date: Tue, 17 Mar 2020 12:12:18 +0100 Subject: [PATCH] KEYCLOAK-5162 Add index to even table --- .../src/main/resources/META-INF/jpa-changelog-9.0.1.xml | 8 ++++++++ .../services/resources/account/AccountFormService.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml b/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml index 16a820ddb5..4019502d39 100644 --- a/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml +++ b/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml @@ -45,4 +45,12 @@ + + + + + + + + diff --git a/services/src/main/java/org/keycloak/services/resources/account/AccountFormService.java b/services/src/main/java/org/keycloak/services/resources/account/AccountFormService.java index e416a117af..58e4004dbb 100755 --- a/services/src/main/java/org/keycloak/services/resources/account/AccountFormService.java +++ b/services/src/main/java/org/keycloak/services/resources/account/AccountFormService.java @@ -295,7 +295,7 @@ public class AccountFormService extends AbstractSecuredLocalService { } if (auth != null) { - List events = eventStore.createQuery().type(Constants.EXPOSED_LOG_EVENTS).user(auth.getUser().getId()).maxResults(30).getResultList(); + List events = eventStore.createQuery().type(Constants.EXPOSED_LOG_EVENTS).realm(auth.getRealm().getId()).user(auth.getUser().getId()).maxResults(30).getResultList(); for (Event e : events) { if (e.getDetails() != null) { Iterator> itr = e.getDetails().entrySet().iterator();