synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
34 lines (33 loc) • 752 B
JavaScript
import { AuthenticationApi as s } from "@sage-bionetworks/aridhia-client/generated/apis";
import { Configuration as i } from "@sage-bionetworks/aridhia-client/generated/runtime";
async function c(n, t, e) {
const a = await new s(
new i({
basePath: t
})
).authenticatePost({
authenticationRequest: {
...e,
subject_token: n
}
});
if (!a.access_token)
throw new Error("Failed to obtain Aridhia access token");
return a;
}
async function h(n, t, e) {
const o = await c(
n,
t,
e
);
return new i({
basePath: t,
accessToken: o.access_token
});
}
export {
h as createAridhiaApiConfiguration,
c as exchangeSynapseTokenForAridhia
};
//# sourceMappingURL=aridhiaTokenExchange.js.map