Skip to content

Commit

Permalink
CDPD-62588, KNOX-2979: Removed redundant 'refresh' query parameter fr…
Browse files Browse the repository at this point in the history
…om the application logout link after originalUrl (apache#815)

Change-Id: I82ee62c7db5894f5b2a384abb41b80321ab37925
  • Loading branch information
smolnar82 authored and Sandor Molnar committed Nov 1, 2023
1 parent ebd1676 commit d5b64e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,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;
}
}
Expand Down
14 changes: 0 additions & 14 deletions knox-homepage-ui/home/app/homepage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,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!',
Expand Down

0 comments on commit d5b64e6

Please sign in to comment.