Target correct user resource

This commit is contained in:
Hynek Mlnarik 2023-04-28 12:05:28 +02:00 committed by Hynek Mlnařík
parent b9983cc5f6
commit 4950f7bebe

View file

@ -31,7 +31,7 @@ import java.util.Optional;
public class AccountHelper { public class AccountHelper {
private static UserResource getUserResource(RealmResource realm, String username) { private static UserResource getUserResource(RealmResource realm, String username) {
Optional<UserRepresentation> userResult = realm.users().search(username).stream().findFirst(); Optional<UserRepresentation> userResult = realm.users().search(username, true).stream().findFirst();
if (userResult.isEmpty()) { if (userResult.isEmpty()) {
throw new RuntimeException("User with username " + username + " not found"); throw new RuntimeException("User with username " + username + " not found");
} }