Try adding this in your code instead of using field level bean creation, use constructor based bean creation for the UserRepo in CustomerDetails class like mentioned by @M.Deinum
import lombok.RequiredArgsConstructor;
@Service("customuserdetails")
@RequiredArgsConstructor
public class CustomUserDetails implements UserDetailsService {
private final UserRepo userrepo;
private final PasswordEncoder bcrypt;
// rest of the code
}
and add the @Configuration annotation instead of @Component to SecurityBeans class
import org.springframework.context.annotation.Configuration;
@Configuration
public class Securitybeans {
//rest of the code
}