summaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2014-10-01 10:54:06 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2014-10-01 10:54:06 +0200
commit86c6f3a65b5b390eea7951e65b9513ed25c309e8 (patch)
tree76c646f5fded0d748f5370f0e23864bc2efd6430 /src/main/java/at
parent6a7f44f110197c67d772b399e6693d18eff0c19d (diff)
downloadegovutils-86c6f3a65b5b390eea7951e65b9513ed25c309e8.tar.gz
egovutils-86c6f3a65b5b390eea7951e65b9513ed25c309e8.tar.bz2
egovutils-86c6f3a65b5b390eea7951e65b9513ed25c309e8.zip
update authentication filter
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/gv/util/filter/moaid/MOAIDAuthenticationFilter.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/at/gv/util/filter/moaid/MOAIDAuthenticationFilter.java b/src/main/java/at/gv/util/filter/moaid/MOAIDAuthenticationFilter.java
index cb16b8f..ab3d3b9 100644
--- a/src/main/java/at/gv/util/filter/moaid/MOAIDAuthenticationFilter.java
+++ b/src/main/java/at/gv/util/filter/moaid/MOAIDAuthenticationFilter.java
@@ -164,11 +164,17 @@ public class MOAIDAuthenticationFilter implements Filter {
// CustomHttpServletRequest(httpServletRequest).toString());
session.setAttribute(STORED_REQUEST_URL_ID, requestURL);
}
+
+ String page = loginPage;
+
+ if (loginPage.startsWith("/") && !loginPage.startsWith("//"))
+ page = httpServletRequest.getContextPath() + loginPage;
+
if (loginPageForward) {
- RequestDispatcher dispatcher = request.getRequestDispatcher(loginPage);
+ RequestDispatcher dispatcher = request.getRequestDispatcher(page);
dispatcher.forward(httpServletRequest, httpServletResponse);
} else {
- httpServletResponse.sendRedirect(httpServletResponse.encodeRedirectURL(loginPage));
+ httpServletResponse.sendRedirect(httpServletResponse.encodeRedirectURL(page));
}
return;
}