Commit fa227c13 authored by BRUVRY-LAGADEC's avatar BRUVRY-LAGADEC 💻
Browse files

Merge branch 'feature/imagine' into feature/imagine-569

parents 78be6134 b9b76a77
......@@ -114,7 +114,7 @@ public class PersonRepositoryImpl
@Override
public Optional<PersonVO> findByUsername(String username) {
return findAll(hasUsername(username)).stream().filter(p -> StatusEnum.ENABLE.equals(p.getStatus())).findFirst().map(this::toVO);
return findAll(hasUsername(username)).stream().filter(p -> StatusEnum.ENABLE.getId().equals(p.getStatus().getId())).findFirst().map(this::toVO);
}
@Override
......
......@@ -147,7 +147,7 @@ public class AuthServiceImpl implements AuthService {
}
@Override
public UserDetails authenticateByUsername(String username, UsernamePasswordAuthenticationToken authentication) {
public UserDetails authenticateByUsername(String username, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
Preconditions.checkArgument(enableAuthBasic);
// First check anonymous user
......@@ -324,7 +324,7 @@ public class AuthServiceImpl implements AuthService {
return null;
}
private void checkEnabledAccount(PersonVO person) throws DataNotFoundException {
private void checkEnabledAccount(PersonVO person) throws DisabledException {
// Cannot auth if user has been deleted or is disable
StatusEnum status = StatusEnum.valueOf(person.getStatusId());
if (StatusEnum.DISABLE.equals(status) || StatusEnum.DELETED.equals(status)) {
......
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