diff --git a/src/main/java/io/wwan13/wintersecurity/config/AuthConfiguration.java b/src/main/java/io/wwan13/wintersecurity/config/AuthConfiguration.java index 502682e..275ead8 100644 --- a/src/main/java/io/wwan13/wintersecurity/config/AuthConfiguration.java +++ b/src/main/java/io/wwan13/wintersecurity/config/AuthConfiguration.java @@ -28,7 +28,6 @@ import io.wwan13.wintersecurity.secretkey.SecretKey; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; public class AuthConfiguration { @@ -64,6 +63,6 @@ public AbstractInterceptorAuthProcessor authProcessor( @Bean public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); + return new io.wwan13.wintersecurity.passwordencoder.PasswordEncoder(); } } diff --git a/src/main/java/io/wwan13/wintersecurity/config/JwtConfiguration.java b/src/main/java/io/wwan13/wintersecurity/config/JwtConfiguration.java index 045a239..b81fa55 100644 --- a/src/main/java/io/wwan13/wintersecurity/config/JwtConfiguration.java +++ b/src/main/java/io/wwan13/wintersecurity/config/JwtConfiguration.java @@ -29,6 +29,7 @@ import io.wwan13.wintersecurity.jwt.provider.JwtTokenDecoder; import io.wwan13.wintersecurity.jwt.provider.JwtTokenGenerator; import io.wwan13.wintersecurity.secretkey.SecretKey; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; public class JwtConfiguration { @@ -43,6 +44,7 @@ public TokenGenerator tokenGenerator( } @Bean + @ConditionalOnMissingBean(TokenDecoder.class) public TokenDecoder tokenDecoder(SecretKey secretKey) { return new JwtTokenDecoder(secretKey); } diff --git a/src/main/java/io/wwan13/wintersecurity/passwordencoder/PasswordEncoder.java b/src/main/java/io/wwan13/wintersecurity/passwordencoder/PasswordEncoder.java new file mode 100644 index 0000000..346095a --- /dev/null +++ b/src/main/java/io/wwan13/wintersecurity/passwordencoder/PasswordEncoder.java @@ -0,0 +1,22 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.wwan13.wintersecurity.passwordencoder; + +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; + +public class PasswordEncoder extends BCryptPasswordEncoder { +}