2016-05-10 12:43:52 +02:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('harbor.services.user')
|
|
|
|
.factory('ResetPasswordService', ResetPasswordService);
|
|
|
|
|
|
|
|
ResetPasswordService.$inject = ['$http', '$log'];
|
|
|
|
|
|
|
|
function ResetPasswordService($http, $log) {
|
|
|
|
return resetPassword;
|
|
|
|
function resetPassword(uuid, password) {
|
|
|
|
return $http({
|
|
|
|
method: 'POST',
|
|
|
|
url: '/reset',
|
|
|
|
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
|
|
|
transformRequest: function(obj) {
|
|
|
|
var str = [];
|
2016-05-23 12:29:17 +02:00
|
|
|
for(var p in obj) {
|
|
|
|
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
|
|
|
|
}
|
2016-05-10 12:43:52 +02:00
|
|
|
return str.join("&");
|
|
|
|
},
|
|
|
|
data: {'reset_uuid': uuid, 'password': password}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|