Skip to content

Commit 73d25a3

Browse files
committed
feat: JWT 인증 필터에서 검증 토큰 처리 로직 개선
1 parent d689717 commit 73d25a3

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/main/java/org/ject/support/common/security/jwt/JwtAuthenticationFilter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
6363

6464
if (verificationToken != null) {
6565
if (jwtTokenProvider.validateToken(verificationToken)) {
66-
// 토큰이 유효한 경우, 인증 정보를 SecurityContext에 설정
67-
Authentication auth = jwtTokenProvider.getAuthenticationByToken(accessToken);
66+
String email = jwtTokenProvider.extractEmailFromVerificationToken(verificationToken);
67+
Authentication auth = createVerificationAuthentication(email);
6868
SecurityContextHolder.getContext().setAuthentication(auth);
6969
} else {
70-
clearAuthCookie(response, "Authentication auth = jwtTokenProvider.getAuthenticationByToken(accessToken);\n" +
71-
" SecurityContextHolder.getContext().setAuthentication(auth);");
70+
clearAuthCookie(response, "verificationToken");
7271
SecurityContextHolder.clearContext();
7372
}
7473

0 commit comments

Comments
 (0)