feat: 隐藏错误

This commit is contained in:
wangyu 2021-01-13 09:11:35 +08:00
parent e55c7a29bd
commit d52b5ad477

View File

@ -16,6 +16,7 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.server.context.ServerSecurityContextRepository;
import org.springframework.stereotype.Service;
@ -51,7 +52,6 @@ public class MongoUserDetailsServiceImpl implements MongoUserDetailsService {
}
private final ReactiveUserService userService;
private final PasswordEncoder passwordEncoder;
@Resource
private ServerSecurityContextRepository contextRepository;
@ -59,10 +59,11 @@ public class MongoUserDetailsServiceImpl implements MongoUserDetailsService {
private ReactiveAuthenticationManager authenticationManager;
@PostConstruct
@SuppressWarnings("deprecation")
private void init() {
UserDetailsRepositoryReactiveAuthenticationManager manager =
new UserDetailsRepositoryReactiveAuthenticationManager(this);
manager.setPasswordEncoder(passwordEncoder);
manager.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
authenticationManager = manager;
}