removed dependency
This commit is contained in:
parent
4d2357b460
commit
410d999727
|
@ -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);
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
]);
|
// ]);
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue