Created
February 22, 2014 11:59
-
-
Save altfatterz/9152846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserDetailsServiceAdapter implements UserDetailsService { | |
@Autowired | |
private AccountRepository accountRepository; | |
@Override | |
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | |
Account account = accountRepository.findByEmail(username); | |
if (account == null) { | |
throw new UsernameNotFoundException(username); | |
} | |
return new UserDetailsAdapter(account); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment