Skip to content

Commit

Permalink
Fix user lookup logic in invitation creation
Browse files Browse the repository at this point in the history
  • Loading branch information
anarsultanov committed Jan 6, 2025
1 parent cd88321 commit e7bc3d1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Response createInvitation(@RequestBody(required = true) TenantInvitationR
throw new ClientErrorException(String.format("Invitation for %s already exists.", email), Response.Status.CONFLICT);
}

UserModel user = KeycloakModelUtils.findUserByNameOrEmail(session, realm, email);
UserModel user = session.users().getUserByEmail(realm, email);
if (user != null && tenant.hasMembership(user)) {
throw new ClientErrorException(String.format("%s is already a member of this organization.", email), Response.Status.CONFLICT);
}
Expand Down

0 comments on commit e7bc3d1

Please sign in to comment.