implement registration validity checks
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-08-09 04:56:54 +02:00
parent c0f655b0df
commit 17dcc0ac4f
9 changed files with 108 additions and 27 deletions

View File

@@ -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"));
}