Skip to content

Commit

Permalink
[refactor] RedisConfig log 3
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeesw committed Sep 15, 2024
1 parent 19c1455 commit 6b078db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/book/backend/global/RedisConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/book/backend/util/JwtUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6b078db

Please sign in to comment.