UNPKG

@arc-publishing/sdk-identity

Version:
23 lines 925 B
import JSONResponseHandler from '../serviceHelpers/JSONResponseHandler'; import Identity from './identity'; import enforceRecaptcha, { RecaptchaMethod } from '../utils/enforceRecaptcha'; import { headers } from './constants'; export default function requestResetPassword(userName, recaptchaToken) { return enforceRecaptcha(RecaptchaMethod.RESET_PASSWORD, recaptchaToken).then(function () { return fetch("".concat(Identity.apiOrigin, "/identity/public/v1/password/reset"), { method: 'POST', headers: headers, body: JSON.stringify({ userName: userName, recaptchaToken: recaptchaToken }) }) .then(JSONResponseHandler) .then(function (json) { if (json.success) { return true; } else { throw json; } }); }); } //# sourceMappingURL=requestResetPassword.js.map