removed dependency

This commit is contained in:
David Baldwynn 2015-06-30 09:19:09 -07:00
parent 4d2357b460
commit 410d999727
3 changed files with 28 additions and 28 deletions

View file

@ -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);
// }
// };
// }
// ]);
// }
// ]);

View file

@ -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();

View file

@ -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,