implement registration validity checks
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -7,11 +7,14 @@ import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import wtf.beatrice.releasehive.repositories.UserRepository;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Configuration
|
||||
public class ApplicationConfiguration
|
||||
{
|
||||
@@ -24,7 +27,7 @@ public class ApplicationConfiguration
|
||||
|
||||
@Bean
|
||||
UserDetailsService userDetailsService() {
|
||||
return email -> userRepository.findByEmail(email)
|
||||
return authParameter -> userRepository.findByEmail(authParameter)
|
||||
.orElseThrow(() -> new UsernameNotFoundException("User not found"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user