Skip to content

Commit

Permalink
feat(session): session redirect시 jsession 테스트 api 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
junhyeongkim2 committed Oct 28, 2024
1 parent 09d810d commit 55305b3
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,22 @@ public ResponseEntity<String> deleteUser(@AuthenticationPrincipal final CustomOA
return ResponseEntity.ok().body("User deleted successfully");
}

@GetMapping("/test/redirect")
public String testRedirect(HttpSession session) {
log.info("현재 세션 ID: {}", session.getId());
// 세션 만료시키기
session.invalidate();
log.info("세션 만료 후 리다이렉트 시작");
return "redirect:/after/redirect";
}

@GetMapping("/after/redirect")
public String afterRedirect(HttpServletRequest request) {
log.info("리다이렉트 후 URL: {}", request.getRequestURL());
log.info("전체 URI: {}", request.getRequestURI());
log.info("쿼리스트링: {}", request.getQueryString());
return "redirected-page";
}


}

0 comments on commit 55305b3

Please sign in to comment.