Open itl-coder opened 1 month ago
Hi, @itl-coder, thanks for reaching out. I'm going to need a bit more information in order to address your issue. Can you provide a sample unit test that causes BCryptPasswordEncoder
to fail how you describe?
You only need to customize a save(User user) in the SpringSecurity environment and encrypt the password field to trigger;
public static String encodePassword(String password) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.encode(password);
}
User user = new User();
user.setUsername("zs");
// encrypt password
user.setPassword(encodePassword("12345678$"));
//
userMapper.save(user);
java.lang.IllegalArgumentException: Illegal group reference at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067) at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:997) at java.base/java.util.regex.Matcher.replaceFirst(Matcher.java:1407) at java.base/java.lang.String.replaceFirst(String.java:2900) at com.linkkou.mybatis.log.LogInterceptor.replaceFirst(LogInterceptor.java:152) at com.linkkou.mybatis.log.LogInterceptor.getCompleteSql(LogInterceptor.java:123) Occurs when storing encrypted data Error:
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); // password include: return passwordEncoder.encode(password); Will consider $ xxx $ to be regular This method will be called automatically: at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067)