Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chapter 5 lack the User class used in the In-memory user detail service #3

Open
chenqping opened this issue Jun 24, 2021 · 1 comment

Comments

@chenqping
Copy link

chenqping commented Jun 24, 2021

@habuma

@kangourouNomade
Copy link

https://github.com/habuma/spring-in-action-6-samples/blob/64c50d1e1eb5485aafecef2749b0bcd1ca2edf38/ch05/taco-cloud-sfc/src/main/java/tacos/security/SecurityConfig.java

@bean
public UserDetailsService userDetailsService(UserRepository userRepo) {
return username -> {
User user = userRepo.findByUsername(username);
if (user != null) {
return user;
}
throw new UsernameNotFoundException(
"User '" + username + "' not found");
};
}

Bad return type in lambda expression: User cannot be converted to UserDetailsService

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants