mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-12 13:23:29 +00:00
SEC-486: Added determineExpiredUrl method to ConcurrentSessionFilter
This commit is contained in:
parent
feadb3582a
commit
feb790ea83
@ -75,8 +75,10 @@ public class ConcurrentSessionFilter extends SpringSecurityFilter implements Ini
|
||||
// Expired - abort processing
|
||||
doLogout(request, response);
|
||||
|
||||
if (expiredUrl != null) {
|
||||
String targetUrl = request.getContextPath() + expiredUrl;
|
||||
String targetUrl = determineExpiredUrl(request, info);
|
||||
|
||||
if (targetUrl != null) {
|
||||
targetUrl = request.getContextPath() + targetUrl;
|
||||
response.sendRedirect(response.encodeRedirectURL(targetUrl));
|
||||
} else {
|
||||
response.getWriter().print("This session has been expired (possibly due to multiple concurrent " +
|
||||
@ -95,6 +97,10 @@ public class ConcurrentSessionFilter extends SpringSecurityFilter implements Ini
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
protected String determineExpiredUrl(HttpServletRequest request, SessionInformation info) {
|
||||
return expiredUrl;
|
||||
}
|
||||
|
||||
private void doLogout(HttpServletRequest request, HttpServletResponse response) {
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user