From 0b0208204e667edb38309f8b10be1e3b9f4b41a7 Mon Sep 17 00:00:00 2001 From: 13wjdgk <13wjdgk@naver.com> Date: Fri, 6 Oct 2023 03:06:01 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20:=20code=20smell=20=EC=88=98?= =?UTF-8?q?=EC=A0=95,=20=EC=95=88=EC=93=B0=EB=8A=94=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/auth/service/DefaultOauthLoginService.java | 1 - .../dangjang/domain/auth/service/JwtTokenProvider.java | 4 ++-- .../dangjang/domain/auth/service/JwtTokenProviderTest.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/coniverse/dangjang/domain/auth/service/DefaultOauthLoginService.java b/src/main/java/com/coniverse/dangjang/domain/auth/service/DefaultOauthLoginService.java index 3e62ff9c..24e208ee 100644 --- a/src/main/java/com/coniverse/dangjang/domain/auth/service/DefaultOauthLoginService.java +++ b/src/main/java/com/coniverse/dangjang/domain/auth/service/DefaultOauthLoginService.java @@ -40,7 +40,6 @@ public class DefaultOauthLoginService implements OauthLoginService { private final UserSearchService userSearchService; private final Map clients; private final UserRepository userRepository; - private final String authorization = "Authorization"; private final JwtTokenProvider jwtTokenProvider; public DefaultOauthLoginService(AuthTokenGenerator authTokenGenerator, UserSearchService userSearchService, List clients, diff --git a/src/main/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProvider.java b/src/main/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProvider.java index cb51558a..cb779c21 100644 --- a/src/main/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProvider.java +++ b/src/main/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProvider.java @@ -28,7 +28,7 @@ */ @Component public class JwtTokenProvider { - private final Key key; + private Key key; private static final String BEARER = "Bearer"; public JwtTokenProvider(@Value("${jwt.secret-key}") String secretKey) { @@ -108,7 +108,7 @@ public String getToken(final String authHeader) { */ public JWTStatus validationToken(String token) { try { - Key key = getKey(); + key = getKey(); Jwts.parserBuilder() .setSigningKey(key) .build() diff --git a/src/test/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProviderTest.java b/src/test/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProviderTest.java index 7cd5bf08..e39e2eac 100644 --- a/src/test/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProviderTest.java +++ b/src/test/java/com/coniverse/dangjang/domain/auth/service/JwtTokenProviderTest.java @@ -14,7 +14,7 @@ @SpringBootTest @TestInstance(TestInstance.Lifecycle.PER_CLASS) -public class JwtTokenProviderTest { +class JwtTokenProviderTest { private final String subject = "12345678"; @Autowired