This is an automated email from the ASF dual-hosted git repository.

smolnar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new d56937358 KNOX-2979 - Removed redundant 'refresh' query parameter from 
the application logout link after originalUrl (#815)
d56937358 is described below

commit d569373582b800c6c0346cb25e5fe5ec06054050
Author: Sandor Molnar <smol...@apache.org>
AuthorDate: Tue Oct 31 15:12:59 2023 +0100

    KNOX-2979 - Removed redundant 'refresh' query parameter from the 
application logout link after originalUrl (#815)
---
 .../main/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 27ddc9602..51363be3b 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 123e762d3..cbad3d580 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<any> {
-        // 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!',

Reply via email to