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'; 'use strict';
// Config HTTP Error Handling // Config HTTP Error Handling
angular.module('users').config(['$httpProvider', // angular.module('users').config(['$httpProvider',
function($httpProvider) { // function($httpProvider) {
// Set the httpProvider "not authorized" interceptor // // Set the httpProvider "not authorized" interceptor
$httpProvider.interceptors.push(['$q', '$location', 'Principal', // $httpProvider.interceptors.push(['$q', '$state', 'Principal',
function($q, $location, Principal) { // function($q, $location, Principal) {
return { // return {
responseError: function(rejection) { // responseError: function(rejection) {
switch (rejection.status) { // switch (rejection.status) {
case 401: // case 401:
// Deauthenticate the global user // // Deauthenticate the global user
// Redirect to signin page // // Redirect to signin page
$location.path('signin'); // $state.go('signin');
break; // break;
case 403: // case 403:
// Add unauthorized behaviour // // Add unauthorized behaviour
break; // break;
} // }
return $q.reject(rejection); // return $q.reject(rejection);
} // }
}; // };
} // }
]); // ]);
} // }
]); // ]);

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('users').controller('PasswordController', ['$scope', '$stateParams', '$http', '$state', 'Principal', angular.module('users').controller('PasswordController', ['$scope', '$stateParams', '$state', 'Principal',
function($scope, $stateParams, $http, $state, Principal) { function($scope, $stateParams, $state, Principal) {
$scope.authentication = Principal; $scope.authentication = Principal;
$scope.authentication.user = Principal.user(); $scope.authentication.user = Principal.user();

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('users').factory('Principal', ['$window', '$q', '$timeout', angular.module('users').factory('Principal', ['$window', '$q', '$timeout', '$http',
function($window, $q, $timeout) { function($window, $q, $timeout, $http) {
var service = { var service = {
_currentUser: null, _currentUser: null,