mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-17 11:45:05 +02:00
extends the functionality of oauth in Stirling PDF
This commit is contained in:
@@ -22,7 +22,11 @@ public class CustomUserDetailsService implements UserDetailsService {
|
||||
|
||||
@Autowired private UserRepository userRepository;
|
||||
|
||||
@Autowired private LoginAttemptService loginAttemptService;
|
||||
private LoginAttemptService loginAttemptService;
|
||||
|
||||
CustomUserDetailsService(LoginAttemptService loginAttemptService) {
|
||||
this.loginAttemptService = loginAttemptService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
@@ -39,6 +43,10 @@ public class CustomUserDetailsService implements UserDetailsService {
|
||||
"Your account has been locked due to too many failed login attempts.");
|
||||
}
|
||||
|
||||
if (user.getPassword() == null || user.getPassword().isEmpty()) {
|
||||
throw new UsernameNotFoundException("Password must not be null");
|
||||
}
|
||||
|
||||
return new org.springframework.security.core.userdetails.User(
|
||||
user.getUsername(),
|
||||
user.getPassword(),
|
||||
|
||||
Reference in New Issue
Block a user