mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-19 05:42:22 +01:00
21 lines
646 B
JavaScript
21 lines
646 B
JavaScript
'use strict';
|
|
|
|
angular.module('users').controller('ChangePasswordController', ['$scope', '$http', '$location', 'Users', 'Authentication',
|
|
function($scope, $http, $location, Users, Authentication) {
|
|
$scope.user = Authentication.user;
|
|
|
|
// Change user password
|
|
$scope.changeUserPassword = function() {
|
|
$scope.success = $scope.error = null;
|
|
|
|
$http.post('/api/users/password', $scope.passwordDetails).success(function(response) {
|
|
// If successful show success message and clear form
|
|
$scope.success = true;
|
|
$scope.passwordDetails = null;
|
|
}).error(function(response) {
|
|
$scope.error = response.message;
|
|
});
|
|
};
|
|
}
|
|
]);
|