removed dependency
This commit is contained in:
parent
4d2357b460
commit
410d999727
|
@ -1,30 +1,30 @@
|
|||
'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
|
||||
// angular.module('users').config(['$httpProvider',
|
||||
// function($httpProvider) {
|
||||
// // Set the httpProvider "not authorized" interceptor
|
||||
// $httpProvider.interceptors.push(['$q', '$state', 'Principal',
|
||||
// function($q, $location, Principal) {
|
||||
// return {
|
||||
// responseError: function(rejection) {
|
||||
// switch (rejection.status) {
|
||||
// case 401:
|
||||
// // Deauthenticate the global user
|
||||
|
||||
|
||||
// Redirect to signin page
|
||||
$location.path('signin');
|
||||
break;
|
||||
case 403:
|
||||
// Add unauthorized behaviour
|
||||
break;
|
||||
}
|
||||
// // Redirect to signin page
|
||||
// $state.go('signin');
|
||||
// break;
|
||||
// case 403:
|
||||
// // Add unauthorized behaviour
|
||||
// break;
|
||||
// }
|
||||
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
};
|
||||
}
|
||||
]);
|
||||
}
|
||||
]);
|
||||
// return $q.reject(rejection);
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
// ]);
|
||||
// }
|
||||
// ]);
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('users').controller('PasswordController', ['$scope', '$stateParams', '$http', '$state', 'Principal',
|
||||
function($scope, $stateParams, $http, $state, Principal) {
|
||||
angular.module('users').controller('PasswordController', ['$scope', '$stateParams', '$state', 'Principal',
|
||||
function($scope, $stateParams, $state, Principal) {
|
||||
$scope.authentication = Principal;
|
||||
$scope.authentication.user = Principal.user();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('users').factory('Principal', ['$window', '$q', '$timeout',
|
||||
function($window, $q, $timeout) {
|
||||
angular.module('users').factory('Principal', ['$window', '$q', '$timeout', '$http',
|
||||
function($window, $q, $timeout, $http) {
|
||||
|
||||
var service = {
|
||||
_currentUser: null,
|
||||
|
|
Loading…
Reference in a new issue