@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
21 lines • 740 B
JavaScript
import { isAPIErrorResponse } from '../serviceHelpers/APIErrorResponse';
import JSONResponseHandler from '../serviceHelpers/JSONResponseHandler';
import Identity from './identity';
import { headers } from './constants';
export default function resetPassword(nonce, newPassword) {
return fetch("".concat(Identity.apiOrigin, "/identity/public/v1/password/reset/").concat(nonce), {
method: 'PUT',
headers: headers,
body: JSON.stringify({ newPassword: newPassword })
})
.then(JSONResponseHandler)
.then(function (json) {
if (isAPIErrorResponse(json)) {
throw json;
}
else {
return true;
}
});
}
//# sourceMappingURL=resetPassword.js.map