Revert "KEYCLOAK-19602 moved create/update admin console event after commit, to prevent false alarm to event listeners" (#10278)
This reverts commit 31d8a927ff
.
This commit is contained in:
parent
314d303a99
commit
2fd5a1f4fc
2 changed files with 4 additions and 2 deletions
|
@ -188,10 +188,11 @@ public class UserResource {
|
|||
session.getProvider(BruteForceProtector.class).cleanUpPermanentLockout(session, realm, user);
|
||||
}
|
||||
|
||||
adminEvent.operation(OperationType.UPDATE).resourcePath(session.getContext().getUri()).representation(rep).success();
|
||||
|
||||
if (session.getTransactionManager().isActive()) {
|
||||
session.getTransactionManager().commit();
|
||||
}
|
||||
adminEvent.operation(OperationType.UPDATE).resourcePath(session.getContext().getUri()).representation(rep).success();
|
||||
return Response.noContent().build();
|
||||
} catch (ModelDuplicateException e) {
|
||||
return ErrorResponse.exists("User exists with same username or email");
|
||||
|
|
|
@ -161,11 +161,12 @@ public class UsersResource {
|
|||
RepresentationToModel.createGroups(rep, realm, user);
|
||||
|
||||
RepresentationToModel.createCredentials(rep, session, realm, user, true);
|
||||
adminEvent.operation(OperationType.CREATE).resourcePath(session.getContext().getUri(), user.getId()).representation(rep).success();
|
||||
|
||||
if (session.getTransactionManager().isActive()) {
|
||||
session.getTransactionManager().commit();
|
||||
}
|
||||
adminEvent.operation(OperationType.CREATE).resourcePath(session.getContext().getUri(), user.getId()).representation(rep).success();
|
||||
|
||||
return Response.created(session.getContext().getUri().getAbsolutePathBuilder().path(user.getId()).build()).build();
|
||||
} catch (ModelDuplicateException e) {
|
||||
if (session.getTransactionManager().isActive()) {
|
||||
|
|
Loading…
Reference in a new issue