Commit 3e7cb66b authored by michael.simon's avatar michael.simon
Browse files

Change findByEppn return type to list

parent e2f2487c
......@@ -342,11 +342,14 @@ public class UserUpdateServiceImpl implements UserUpdateService, Serializable {
}
private UserEntity findUser(String eppn) {
UserEntity user = userDao.findByEppn(eppn);
List<UserEntity> userList = userDao.findByEppn(eppn);
if (userList.size() == 0)
return null;
else if (userList.size() > 1)
return null;
if (user != null) {
user = userDao.findByIdWithStore(user.getId());
}
UserEntity user = userList.get(0);
user = userDao.findByIdWithStore(user.getId());
return user;
}
......
......@@ -63,9 +63,12 @@ public class TwoFaLoginServiceImpl implements TwoFaLoginService {
if (eppn != null) {
if (eppn.contains("@")) {
user = userDao.findByEppn(eppn);
if (user == null)
List<UserEntity> userList = userDao.findByEppn(eppn);
if (userList.size() == 0)
throw new NoUserFoundException("no such user");
else if (userList.size() > 1)
throw new NoUserFoundException("user eppn not unique");
user = userList.get(0);
registry = findRegistry(user, service);
if (registry == null)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment