Created
July 7, 2025 18:53
-
-
Save jeffersonchaves/71d6c4a0c0490f1cc3167c885b2dc359 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
| @Service | |
| public class UserDetailService implements UserDetailsService { | |
| @Autowired | |
| UserRepository userRepository; | |
| @Override | |
| public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | |
| return userRepository.findByUsername(username) | |
| .map(UserAuthenticated::new) | |
| .orElseThrow(() -> new UsernameNotFoundException("Usuário não encontrado")); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment