|
@ -42,24 +42,29 @@ public class SessionOutTimeFilter extends OncePerRequestFilter {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
String token = httpServletRequest.getParameter(ContextAttributes.ACCESSTOKEN);
|
|
|
String clientId = httpServletRequest.getParameter(ContextAttributes.CLIENTID);
|
|
|
String token = null;
|
|
|
String clientId = null;
|
|
|
String contentType = httpServletRequest.getHeader("content-type");
|
|
|
if (contentType != null && !contentType.contains("multipart/form-data")) {
|
|
|
token = httpServletRequest.getParameter("token");
|
|
|
clientId = httpServletRequest.getParameter("clientId");
|
|
|
}
|
|
|
|
|
|
if (token == null || clientId == null){
|
|
|
if (httpServletRequest.getSession(false) == null
|
|
|
|| httpServletRequest.getSession().getAttribute("userInfo")==null) {
|
|
|
if (token == null || clientId == null) {
|
|
|
if (httpServletRequest.getSession(false) == null
|
|
|
|| httpServletRequest.getSession().getAttribute("userInfo") == null) {
|
|
|
|
|
|
// AJAX REQUEST PROCESS
|
|
|
String attachment = LocalContext.getContext().getAttachment(ContextAttributes.TENANT_NAME);
|
|
|
if ("XMLHttpRequest".equalsIgnoreCase(httpServletRequest.getHeader("X-Requested-With"))) {
|
|
|
httpServletResponse.setHeader("sessionStatus", "timeOut");
|
|
|
httpServletResponse.getWriter().print("{}");
|
|
|
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/logoutAction");
|
|
|
// AJAX REQUEST PROCESS
|
|
|
String attachment = LocalContext.getContext().getAttachment(ContextAttributes.TENANT_NAME);
|
|
|
if ("XMLHttpRequest".equalsIgnoreCase(httpServletRequest.getHeader("X-Requested-With"))) {
|
|
|
httpServletResponse.setHeader("sessionStatus", "timeOut");
|
|
|
httpServletResponse.getWriter().print("{}");
|
|
|
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/logoutAction");
|
|
|
return;
|
|
|
}
|
|
|
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/" + attachment + "/loginPage");
|
|
|
return;
|
|
|
}
|
|
|
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/" +attachment+ "/loginPage");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
filterChain.doFilter(httpServletRequest, httpServletResponse);
|