@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
21 lines • 698 B
JavaScript
import { isUserIdentity } from './userIdentity';
import JSONResponseHandler from '../serviceHelpers/JSONResponseHandler';
import Identity from './identity';
import { headers } from './constants';
export default function redeemOTALink(nonce) {
return fetch("".concat(Identity.apiOrigin, "/identity/public/v1/auth/magiclink/").concat(nonce), {
method: 'GET',
headers: headers
})
.then(JSONResponseHandler)
.then(function (json) {
if (isUserIdentity(json)) {
Identity.userIdentity = json;
return Identity.userIdentity;
}
else {
throw json;
}
});
}
//# sourceMappingURL=redeemOTALink.js.map