From d569373582b800c6c0346cb25e5fe5ec06054050 Mon Sep 17 00:00:00 2001 From: Sandor Molnar Date: Tue, 31 Oct 2023 15:12:59 +0100 Subject: [PATCH] KNOX-2979 - Removed redundant 'refresh' query parameter from the application logout link after originalUrl (#815) --- .../resources/applications/knoxauth/app/logout.jsp | 8 ++------ knox-homepage-ui/home/app/homepage.service.ts | 14 -------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/gateway-applications/src/main/resources/applications/knoxauth/app/logout.jsp b/gateway-applications/src/main/resources/applications/knoxauth/app/logout.jsp index 27ddc96020..51363be3b4 100644 --- a/gateway-applications/src/main/resources/applications/knoxauth/app/logout.jsp +++ b/gateway-applications/src/main/resources/applications/knoxauth/app/logout.jsp @@ -90,17 +90,13 @@ boolean validRedirect = false; String origUrl = request.getParameter("originalUrl"); - String del = "?"; - if (origUrl != null && origUrl.contains("?")) { - del = "&"; - } if (origUrl != null) { validRedirect = RegExUtils.checkWhitelist(whitelist, origUrl); } if (("1".equals(request.getParameter("returnToApp")))) { if (validRedirect) { - response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); - response.setHeader("Location",originalUrl + del + "refresh=1"); + response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); + response.setHeader("Location", originalUrl); return; } } diff --git a/knox-homepage-ui/home/app/homepage.service.ts b/knox-homepage-ui/home/app/homepage.service.ts index 123e762d32..cbad3d5809 100644 --- a/knox-homepage-ui/home/app/homepage.service.ts +++ b/knox-homepage-ui/home/app/homepage.service.ts @@ -132,20 +132,6 @@ export class HomepageService { } private handleError(error: HttpErrorResponse): Promise { - // location.reload(); - let refresh; - this.route.queryParams.subscribe(params => { - refresh = params['refresh']; - console.debug('refresh = ' + refresh); - if (refresh) { - console.debug('Refreshing page...', window.location.href); - let url = window.location.pathname.replace(new RegExp('refresh=1/.*'), '?'); - // var url = window.location.pathname; - - // window.location.assign(url); - window.location.reload(); - } - }); Swal.fire({ icon: 'error', title: 'Oops!',