package kr.wisestone.owl.config.security.strategy;
|
|
import org.springframework.security.web.session.SessionInformationExpiredEvent;
|
import org.springframework.security.web.session.SessionInformationExpiredStrategy;
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.IOException;
|
|
public class SecuritySessionExpiredStrategy implements SessionInformationExpiredStrategy {
|
|
private String defaultUrl;
|
|
public SecuritySessionExpiredStrategy(String defaultUrl) {
|
this.defaultUrl = defaultUrl;
|
}
|
|
@Override
|
public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException {
|
HttpServletResponse response = event.getResponse();
|
response.sendRedirect(this.defaultUrl);
|
}
|
|
}
|