Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Mar 25, 2014
1 parent 76732bb commit e84746f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
44 changes: 22 additions & 22 deletions public/modules/users/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

// Config HTTP Error Handling
angular.module('mean.users').config(['$httpProvider',
function($httpProvider) {
function($httpProvider) {
// Set the httpProvider "not authorized" interceptor
$httpProvider.interceptors.push(['$q', '$location', 'Authentication',
function($q, $location, Authentication) {
return {
responseError: function(rejection) {
switch (rejection.status) {
case 401:
// Deauthenticate the global user
Authentication.user = null;
$httpProvider.interceptors.push(['$q', '$location', 'Authentication',
function($q, $location, Authentication) {
return {
responseError: function(rejection) {
switch (rejection.status) {
case 401:
// Deauthenticate the global user
Authentication.user = null;

// Redirect to signin page
$location.path('signin');
break;
case 403:
// Add unauthorized behaviour
break;
}
// Redirect to signin page
$location.path('signin');
break;
case 403:
// Add unauthorized behaviour
break;
}

return $q.reject(rejection);
}
};
}
]);
}
return $q.reject(rejection);
}
};
}
]);
}
]);
12 changes: 6 additions & 6 deletions public/modules/users/controllers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ angular.module('mean.users').controller('SettingsController', ['$scope', '$http'
$scope.user = Authentication.user;

//If user is not signed in then redirect back home
if (!$scope.user) $location.path('/');
if (!$scope.user) $location.path('/');

$scope.updateUserProfile = function() {
$scope.success = $scope.error = null;
Expand All @@ -23,12 +23,12 @@ angular.module('mean.users').controller('SettingsController', ['$scope', '$http'
$scope.success = $scope.error = null;

$http.post('/users/password', $scope.passwordDetails).success(function(response) {
// If successful show success message and clear form
// If successful show success message and clear form
$scope.success = true;
$scope.passwordDetails = null;
}).error(function(response) {
$scope.error = response.message;
});
$scope.passwordDetails = null;
}).error(function(response) {
$scope.error = response.message;
});
};
}
]);

0 comments on commit e84746f

Please sign in to comment.