From 65cf41317dfb56b21b482a6350d2432dded01923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=A9=ED=98=B8=EC=9C=A4?= Date: Mon, 29 Jan 2024 20:09:17 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A6=AC=ED=94=84=EB=A0=88=EC=8B=9C=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=20db=20=EA=B0=92=EC=9D=B4=EB=9E=91=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chwipoClova/common/utils/JwtUtil.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/chwipoClova/common/utils/JwtUtil.java b/src/main/java/com/chwipoClova/common/utils/JwtUtil.java index 64e9ed1..a010d00 100644 --- a/src/main/java/com/chwipoClova/common/utils/JwtUtil.java +++ b/src/main/java/com/chwipoClova/common/utils/JwtUtil.java @@ -122,7 +122,8 @@ public Boolean refreshTokenValidation(String token) { // DB에 저장한 토큰 비교 Optional refreshToken = tokenRepository.findByUserUserId(userId); - return refreshToken.isPresent() && token.equals(refreshToken.get().getRefreshToken()); + //return refreshToken.isPresent() && token.equals(refreshToken.get().getRefreshToken()); + return refreshToken.isPresent(); } // 인증 객체 생성 @@ -157,13 +158,6 @@ public void setCookieRefreshToken(HttpServletResponse response, String refreshTo .httpOnly(true) .build(); response.addHeader(HttpHeaders.SET_COOKIE, responseCookie.toString()); - /*response.setHeader(HttpHeaders.SET_COOKIE, responseCookie.toString()); - Cookie cookie = new Cookie(REFRESH_TOKEN, refreshToken); - cookie.setMaxAge(REFRESH_COOKIE_TIME); - cookie.setHttpOnly(true); - //cookie.setSecure(true); - cookie.setPath("/"); - response.addCookie(cookie);*/ } public void setDelCookieRefreshToken(HttpServletResponse response) { @@ -176,14 +170,6 @@ public void setDelCookieRefreshToken(HttpServletResponse response) { .httpOnly(true) .build(); response.setHeader(HttpHeaders.SET_COOKIE, responseCookie.toString()); - -/* Cookie cookie = new Cookie(REFRESH_TOKEN, null); - cookie.setMaxAge(0); - cookie.setHttpOnly(true); - //cookie.setSecure(true); - cookie.setPath("/"); - response.addCookie(cookie);*/ - } public String getCookieToken(HttpServletRequest request, String type) {