Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Add some logging to user service
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Cochran committed Jul 28, 2011
1 parent b483f10 commit 5b50da5
Showing 1 changed file with 7 additions and 9 deletions.
Expand Up @@ -17,27 +17,25 @@
public class AuthenticationService implements UserDetailsService {
@Autowired
private UserDAO userDAO;

@SuppressWarnings("unused")
private Logger log = Logger.getLogger(AuthenticationService.class);

/**
* {@inheritDoc}
*/
@Override
public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException, DataAccessException {
User u = userDAO.getUser(userName);
User u = userDAO.getUser(userName);
if (u == null) {
log.warn("User " + userName + " not found.");
throw new UsernameNotFoundException("User " + userName + " not found.");
// u = userDAO.getRootUser(userName);
// if(u == null) {
// throw new UsernameNotFoundException("User " + userName + " not found.");
// }
}
log.info("User " + userName + " found, id " + u.getId().toString() + ".");
return new UserDetails(u);
}


public User getUserByRegistrationKey(String rego){
User u = userDAO.getUserByRegistrationKey(rego);
return u;
Expand Down

0 comments on commit 5b50da5

Please sign in to comment.