Closed kimhanui closed 4 years ago
successHandler의
protected void resultRedirectStrategy(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
SavedRequest savedRequest = requestCache.getRequest(request, response);
String defaultUrl = "/";
log.info("savedRequeset : "+ savedRequest);
// String targetUrl = savedRequest.getRedirectUrl(); <- 이부분 if문으로 옮김
if (savedRequest != null) {
String targetUrl = savedRequest.getRedirectUrl(); //<- 여기
redirectStrategy.sendRedirect(request, response, targetUrl);
} else {
redirectStrategy.sendRedirect(request, response, defaultUrl);
}
}
증상
시나리오
CustomLoginSuccessHandler.java
savedRequest에 null이 들어가서 NPE 뜸.
screenshot
response
server log
실행 환경