Skip to content

Commit

Permalink
KNOX-2979 - Removed redundant 'refresh' query parameter from the appl…
Browse files Browse the repository at this point in the history
…ication logout link after originalUrl (#815)
  • Loading branch information
smolnar82 authored Oct 31, 2023
1 parent 6ec81a0 commit d569373
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 @@ -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;
}
}
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 @@ -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!',
Expand Down

0 comments on commit d569373

Please sign in to comment.