summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-os
diff options
context:
space:
mode:
authorWilliam Kurkian <wkurkian@cisco.com>2018-05-08 11:59:38 -0400
committerWilliam Kurkian <wkurkian@cisco.com>2018-05-30 10:12:57 -0400
commite8ed77b3f1d952754f36a0258f44acecd0aceeb3 (patch)
tree448ff3d12df38ff4f001ba3936de01d210cc46a1 /ecomp-portal-BE-os
parenteb12d98507bfc22bdd504fe6e522ea0287c445f6 (diff)
Changed app to redirect when the session expires.
Reverted previous change to redirect from incorrect login screens. Instead, navigating to the main application page without a valid session results in being sent to the login page Removed some mistaken changes These didn't relate to the fix Issue-ID: PORTAL-278 Change-Id: I82c4a1ed26ede0119cdc4d1f9b818780ca876801 Signed-off-by: William Kurkian <wkurkian@cisco.com>
Diffstat (limited to 'ecomp-portal-BE-os')
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java
index d0d3d48c..dd201edd 100644
--- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java
+++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java
@@ -52,6 +52,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
public class SessionTimeoutInterceptor extends HandlerInterceptorAdapter {
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionTimeoutInterceptor.class);
@@ -79,7 +81,9 @@ public class SessionTimeoutInterceptor extends HandlerInterceptorAdapter {
if (!controller.isAccessible()) {
try {
EPUser user = EPUserUtils.getUserSession(request);
-
+ if (user == null) {
+ throw new SessionExpiredException();
+ }
if (request.getRequestURI().indexOf("logout.htm") > -1) {
CollaborateList.delUserName(user.getOrgUserId());
throw new SessionExpiredException();
@@ -87,6 +91,9 @@ public class SessionTimeoutInterceptor extends HandlerInterceptorAdapter {
resetSessionMaxIdleTimeOut(request);
CollaborateList.addUserName(user.getOrgUserId());
}
+ } catch (SessionExpiredException e) {
+ response.sendRedirect(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL));
+ return false;
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "preHandle failed", e);
return false;
@@ -115,4 +122,4 @@ public class SessionTimeoutInterceptor extends HandlerInterceptorAdapter {
return true;
return false;
}
-} \ No newline at end of file
+}