Copilot commented on code in PR #7870:
URL: https://github.com/apache/incubator-seata/pull/7870#discussion_r2629695186


##########
console/src/main/java/org/apache/seata/console/config/WebSecurityConfig.java:
##########
@@ -79,60 +84,60 @@ public class WebSecurityConfig extends 
WebSecurityConfigurerAdapter {
     @Autowired
     private Environment env;
 
-    @Bean(name = BeanIds.AUTHENTICATION_MANAGER)
-    @Override
-    public AuthenticationManager authenticationManagerBean() throws Exception {
-        return super.authenticationManagerBean();
+    @Bean
+    public PasswordEncoder passwordEncoder() {
+        return new BCryptPasswordEncoder();
     }
 
-    @Override
-    protected void configure(AuthenticationManagerBuilder auth) throws 
Exception {
-        
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
+    @Bean
+    public AuthenticationManager authenticationManager() {
+        DaoAuthenticationProvider authenticationProvider = new 
DaoAuthenticationProvider(userDetailsService);

Review Comment:
   The DaoAuthenticationProvider constructor does not accept a 
UserDetailsService parameter in Spring Security 6.x (used by Spring Boot 3.x). 
Instead, you should use the default constructor and then call 
setUserDetailsService(). The correct usage should be: DaoAuthenticationProvider 
authenticationProvider = new DaoAuthenticationProvider(); 
authenticationProvider.setUserDetailsService(userDetailsService); 
authenticationProvider.setPasswordEncoder(passwordEncoder());
   ```suggestion
           DaoAuthenticationProvider authenticationProvider = new 
DaoAuthenticationProvider();
           authenticationProvider.setUserDetailsService(userDetailsService);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to