@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
25 lines • 959 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var userIdentity_1 = require("./userIdentity");
var JSONResponseHandler_1 = tslib_1.__importDefault(require("../serviceHelpers/JSONResponseHandler"));
var identity_1 = tslib_1.__importDefault(require("./identity"));
var constants_1 = require("./constants");
function redeemOTALink(nonce) {
return fetch("".concat(identity_1.default.apiOrigin, "/identity/public/v1/auth/magiclink/").concat(nonce), {
method: 'GET',
headers: constants_1.headers
})
.then(JSONResponseHandler_1.default)
.then(function (json) {
if ((0, userIdentity_1.isUserIdentity)(json)) {
identity_1.default.userIdentity = json;
return identity_1.default.userIdentity;
}
else {
throw json;
}
});
}
exports.default = redeemOTALink;
//# sourceMappingURL=redeemOTALink.js.map