mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-23 10:54:17 +00:00
Fix SAML2 session timeout during XHR requests
This commit is contained in:
@@ -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 class="ng-hide" src="' + $window.UserFolderURL + 'recover"></iframe>');
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user