diff --git a/public/modules/users/config/config.js b/public/modules/users/config/config.js index 2f1a9b25e1..1c52c8a2a8 100644 --- a/public/modules/users/config/config.js +++ b/public/modules/users/config/config.js @@ -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); + } + }; + } + ]); + } ]); \ No newline at end of file diff --git a/public/modules/users/controllers/settings.js b/public/modules/users/controllers/settings.js index 43b3156c8d..e766fdc280 100644 --- a/public/modules/users/controllers/settings.js +++ b/public/modules/users/controllers/settings.js @@ -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; @@ -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; + }); }; } ]); \ No newline at end of file