mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-04 08:03:37 +01:00
29 lines
791 B
JavaScript
29 lines
791 B
JavaScript
|
(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 = [];
|
||
|
for(var p in obj)
|
||
|
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
|
||
|
return str.join("&");
|
||
|
},
|
||
|
data: {'reset_uuid': uuid, 'password': password}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
})();
|