From b8958b931edae0258b819e4d99ce665e984b2333 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 27 Apr 2018 11:06:04 -0400 Subject: [PATCH] Fix SAML2 session timeout during XHR requests --- UI/WebServerResources/js/Common/Common.app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/WebServerResources/js/Common/Common.app.js b/UI/WebServerResources/js/Common/Common.app.js index 93c23f353..04fa7843d 100644 --- a/UI/WebServerResources/js/Common/Common.app.js +++ b/UI/WebServerResources/js/Common/Common.app.js @@ -267,8 +267,7 @@ var deferred, iframe; if (/^application\/json/.test(rejection.config.headers.Accept)) { // Handle CAS ticket renewal - if (($window.usesCASAuthentication && rejection.status == -1) || - ($window.usesSAML2Authentication && rejection.status == 401)) { + if ($window.usesCASAuthentication && rejection.status == -1) { deferred = $q.defer(); iframe = angular.element(''); iframe.on('load', function() { @@ -280,6 +279,9 @@ document.body.appendChild(iframe[0]); return deferred.promise; } + else if ($window.usesSAML2Authentication && rejection.status == 401) { + $window.location.reload(true); + } else { // Broadcast the response error $rootScope.$broadcast('http:Error', rejection);