UNPKG

@arc-publishing/sdk-identity

Version:
25 lines 985 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var APIErrorResponse_1 = require("../serviceHelpers/APIErrorResponse"); var JSONResponseHandler_1 = tslib_1.__importDefault(require("../serviceHelpers/JSONResponseHandler")); var identity_1 = tslib_1.__importDefault(require("./identity")); var constants_1 = require("./constants"); function resetPassword(nonce, newPassword) { return fetch("".concat(identity_1.default.apiOrigin, "/identity/public/v1/password/reset/").concat(nonce), { method: 'PUT', headers: constants_1.headers, body: JSON.stringify({ newPassword: newPassword }) }) .then(JSONResponseHandler_1.default) .then(function (json) { if ((0, APIErrorResponse_1.isAPIErrorResponse)(json)) { throw json; } else { return true; } }); } exports.default = resetPassword; //# sourceMappingURL=resetPassword.js.map