Skip to content

Commit

Permalink
#205 Refactor: logout 시에 access token도 null 로 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
betgws committed Nov 18, 2024
1 parent ddb2fd4 commit cad51b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/drinkeg/drinkeg/jwt/CustomLogoutFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ private void doFilter(HttpServletRequest request, HttpServletResponse response,
cookie.setMaxAge(0);
cookie.setPath("/");

Cookie accessTokenCookie = new Cookie("accessToken", null);
accessTokenCookie.setPath("/");
accessTokenCookie.setMaxAge(0);

response.addCookie(cookie);
response.addCookie(accessTokenCookie);
response.setStatus(HttpServletResponse.SC_OK);

response.setContentType("application/json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ public void createCookie(HttpServletResponse response, String key, String value)

}

// public void createRefreshCookie(HttpServletResponse response, String key, String value) {
//
// ResponseCookie cookie = ResponseCookie.from(key, value)
// .httpOnly(true)
// .secure(true) // HTTPS만 허용
// .path("/")
// .sameSite("Strict") // SameSite 설정
// .maxAge(24 * 60 * 60) // 1일
// .build();
// response.addHeader("Set-Cookie", cookie.toString());
//
// }


public void reissueRefreshToken(HttpServletRequest request, HttpServletResponse response) {

Expand Down

0 comments on commit cad51b7

Please sign in to comment.