From 6b078db6dd7bb868953af404030715fac2fb7b36 Mon Sep 17 00:00:00 2001 From: hyeesw Date: Sun, 15 Sep 2024 22:28:31 +0900 Subject: [PATCH] [refactor] RedisConfig log 3 --- .../com/book/backend/domain/auth/service/OAuthService.java | 4 +++- src/main/java/com/book/backend/global/RedisConfig.java | 4 +--- src/main/java/com/book/backend/util/JwtUtil.java | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/book/backend/domain/auth/service/OAuthService.java b/src/main/java/com/book/backend/domain/auth/service/OAuthService.java index d303f9f..56d9769 100644 --- a/src/main/java/com/book/backend/domain/auth/service/OAuthService.java +++ b/src/main/java/com/book/backend/domain/auth/service/OAuthService.java @@ -36,7 +36,7 @@ public class OAuthService { // 소셜 로그인 @Transactional public LoginSuccessResponseDto oAuthLogin(Provider provider, String idToken, Boolean isCustom) { // isCustom: 개발용 - log.trace("OAuthService > oAuthLogin() ??"); + log.trace("OAuthService > oAuthLogin() !!!"); if (idToken == null || idToken.isEmpty()){ throw new CustomException(ErrorCode.ID_TOKEN_IS_NULL); } @@ -91,6 +91,8 @@ public LoginSuccessResponseDto oAuthLogin(Provider provider, String idToken, Boo // Redis에 RefreshToken 저장 jwtUtil.storeRefreshTokenInRedis(authentication, jwtTokenDto.getRefreshToken()); + log.trace("???? 94"); + return LoginSuccessResponseDto.builder() .userId(user.getUserId()) .isNewUser(isNewUser) diff --git a/src/main/java/com/book/backend/global/RedisConfig.java b/src/main/java/com/book/backend/global/RedisConfig.java index d538148..4cd2343 100644 --- a/src/main/java/com/book/backend/global/RedisConfig.java +++ b/src/main/java/com/book/backend/global/RedisConfig.java @@ -25,10 +25,8 @@ public class RedisConfig { @Bean public RedisConnectionFactory redisConnectionFactory() { - RedisStandaloneConfiguration redisConfiguration = new RedisStandaloneConfiguration(); log.trace("RedisConfig > redisConnectionFactory() > host: {}, port: {}, password: {}", host, port, password); - redisConfiguration.setHostName(host); - redisConfiguration.setPort(port); + RedisStandaloneConfiguration redisConfiguration = new RedisStandaloneConfiguration(host, port); redisConfiguration.setPassword(password); return new LettuceConnectionFactory(redisConfiguration); } diff --git a/src/main/java/com/book/backend/util/JwtUtil.java b/src/main/java/com/book/backend/util/JwtUtil.java index 4ada042..1f7bd58 100644 --- a/src/main/java/com/book/backend/util/JwtUtil.java +++ b/src/main/java/com/book/backend/util/JwtUtil.java @@ -131,6 +131,8 @@ private boolean isTokenExpired(String token) { // Redis에 RefreshToken 저장 public void storeRefreshTokenInRedis(Authentication authentication, String refreshToken) { + log.trace("JwtUtil > storeRefreshTokenInRedis()"); + redisTemplate.getClientList().forEach(client -> log.trace(client.getName())); redisTemplate.opsForValue().set( authentication.getName(), refreshToken,