KEYCLOAK-4899 Replace updates to user session with temporary auth session

This commit is contained in:
Hynek Mlnarik committed 2017-09-11 21:43:49 +02:00
1 parent 9032889c15
commit 24e9cbb292
13 files changed
+329 -95

No files matched your search

@@ -82,25 +82,28 @@ public class UserSessionAdapter implements UserSessionModel {
});
}
// Update user session
if (!removedClientUUIDS.isEmpty()) {
UserSessionUpdateTask task = new UserSessionUpdateTask() {
@Override
public void runUpdate(UserSessionEntity entity) {
for (String clientUUID : removedClientUUIDS) {
entity.getAuthenticatedClientSessions().remove(clientUUID);
}
}
};
update(task);
}
removeAuthenticatedClientSessions(removedClientUUIDS);
return Collections.unmodifiableMap(result);
}
@Override
public void removeAuthenticatedClientSessions(Iterable<String> removedClientUUIDS) {
if (removedClientUUIDS == null || ! removedClientUUIDS.iterator().hasNext()) {
return;
}
// Update user session
UserSessionUpdateTask task = new UserSessionUpdateTask() {
@Override
public void runUpdate(UserSessionEntity entity) {
removedClientUUIDS.forEach(entity.getAuthenticatedClientSessions()::remove);
}
};
update(task);
}
public String getId() {
return entity.getId();
}