(js) Improve CAS handling

pull/236/head
Francis Lachapelle 2017-05-08 15:43:10 -04:00
parent ba583f41b1
commit 836700fb7e
1 changed files with 4 additions and 4 deletions

View File

@ -255,14 +255,14 @@
/**
* @ngInject
*/
ErrorInterceptor.$inject = ['$rootScope', '$q', '$injector'];
function ErrorInterceptor($rootScope, $q, $injector) {
ErrorInterceptor.$inject = ['$rootScope', '$window', '$q', '$injector'];
function ErrorInterceptor($rootScope, $window, $q, $injector) {
return {
responseError: function(rejection) {
var deferred, iframe;
if (/^application\/json/.test(rejection.config.headers.Accept)) {
// Handle CAS ticket renewal (TODO: add check on usesCASAuthentication)
if (rejection.status == -1) {
// Handle CAS ticket renewal
if ($window.usesCASAuthentication && rejection.status == -1) {
deferred = $q.defer();
iframe = angular.element('<iframe class="ng-hide" src="' + UserFolderURL + 'recover"></iframe>');
iframe.on('load', function() {