From 1dadca2eae9fd7dd405b3520fbdfb6448a086837 Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 16 Mar 2021 20:39:39 +0100 Subject: [PATCH] fixed minor bug institutional gui redirect --- .../gui/InstitutionalAuthenticationEntryPoint.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java b/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java index d497e66a..39586d96 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java @@ -118,6 +118,11 @@ public final class InstitutionalAuthenticationEntryPoint implements Authenticati if (StringUtils.isNoneBlank(institutionalEndpoint) && log.isDebugEnabled()) { log.debug("No default gui entrypoint requested: {}", institutionalEndpoint); + } else { + request.getSession().setAttribute(INST_SUFFIX_ATTRIBUTE, null); + request.getSession().removeAttribute(API.PARAM_LOGO_IMAGE); + forwardToEntryPoint(request, response, this.guiEntryPoint, false); + return; } try { @@ -198,6 +203,9 @@ public final class InstitutionalAuthenticationEntryPoint implements Authenticati public static String extractInstitutionalEndpoint(final HttpServletRequest request) { final String requestURI = request.getRequestURI(); + if (StringUtils.isBlank(requestURI) || requestURI.equals(Constants.SLASH.toString())) { + return null; + } if (log.isDebugEnabled()) { log.debug("Trying to verify institution from requested entrypoint url: {}", requestURI);