30 lines
781 B
JavaScript
30 lines
781 B
JavaScript
|
// 'use strict';
|
||
|
|
||
|
// // Config HTTP Error Handling
|
||
|
// angular.module('users').config(['$httpProvider',
|
||
|
// function($httpProvider) {
|
||
|
// // Set the httpProvider "not authorized" interceptor
|
||
|
// $httpProvider.interceptors.push(['$q', '$location', 'Principal',
|
||
|
// function($q, $location, Principal) {
|
||
|
// return {
|
||
|
// responseError: function(rejection) {
|
||
|
// switch (rejection.status) {
|
||
|
// case 401:
|
||
|
// // Deauthenticate the global user
|
||
|
// Principal.authenticate(null);
|
||
|
|
||
|
// // Redirect to signin page
|
||
|
// $location.path('signin');
|
||
|
// break;
|
||
|
// case 403:
|
||
|
// // Add unauthorized behaviour
|
||
|
// break;
|
||
|
// }
|
||
|
|
||
|
// return $q.reject(rejection);
|
||
|
// }
|
||
|
// };
|
||
|
// }
|
||
|
// ]);
|
||
|
// }
|
||
|
// ]);
|