Skip to content

Commit c145a1e

Browse files
committed
fix: 토큰 추출 로직 수정
1 parent 8fe847a commit c145a1e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/java/com/example/log4u/common/oauth2/jwt/JwtLogoutFilter.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,18 @@ private boolean validateTokenExpiration(
126126
}
127127

128128
private String extractRefreshTokenFromCookie(HttpServletRequest request) {
129-
// 리프레시 토큰 추출
130-
String refresh = null;
131129
Cookie[] cookies = request.getCookies();
130+
if (cookies == null) {
131+
return null;
132+
}
133+
132134
for (Cookie cookie : cookies) {
133-
if (cookie.getName().equals(REFRESH_TOKEN)) {
134-
refresh = cookie.getValue();
135+
if (REFRESH_TOKEN.equals(cookie.getName())) {
136+
return cookie.getValue();
135137
}
136138
}
137-
return refresh;
139+
140+
return null;
138141
}
139142

140143
public void logout(HttpServletResponse response, String refresh) throws IOException {

0 commit comments

Comments
 (0)