Skip to content

Commit 8e44b23

Browse files
authored
[chore] 인증 로직 로그 추가 (#255)
1 parent 536904a commit 8e44b23

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

backend/src/main/java/com/back/global/security/CustomAuthenticationFilter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ private void handleErrorException(
157157
cookieManager.deleteAuthCookies(request, response);
158158
}
159159

160+
log.error("CustomAuthenticationFilter: ", error);
160161
writeError(response, error.getErrorCode());
161162
}
162163

@@ -200,6 +201,8 @@ private String ensureValidAccessToken(
200201
return accessToken;
201202
}
202203

204+
log.info("Expired Access Token → Try to Issue new Access Token, expired access token: {}",
205+
accessToken);
203206
String refreshTokenStr = resolveCookie(request, CookieManager.REFRESH_TOKEN_COOKIE);
204207

205208
if (StringUtils.isBlank(refreshTokenStr) || jwtProvider.isExpired(refreshTokenStr)) {

backend/src/main/java/com/back/global/security/JwtProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
import com.back.global.utils.JwtUtil;
1414

1515
import lombok.Getter;
16+
import lombok.extern.slf4j.Slf4j;
1617

1718
@Component
1819
@Getter
20+
@Slf4j
1921
public class JwtProvider {
2022

2123
@Value("${custom.jwt.secret}")
@@ -59,6 +61,7 @@ private String generateToken(
5961
claims.put(CLAIM_SESSION_ID, sessionId);
6062
claims.put(CLAIM_TOKEN_VERSION, tokenVersion);
6163

64+
log.info("Generate Token({}), userId: {}", tokenType, user.getId());
6265
return JwtUtil.sign(secret, durationSeconds, claims);
6366
}
6467

0 commit comments

Comments
 (0)