Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bits and pieces
/**
* Given a username and password, make a https request for a token
*/
getToken (username, password, portalBaseUrl) {
const url = `${portalBaseUrl}/sharing/rest/generateToken?f=json`;
let options = {
method: 'POST',
form: {
username: username,
password: password,
referer: portalBaseUrl
},
json: true
};
// fire the request
return request.post(url, options);
}
/**
* Proxy to the fetch that is imported during the build process
*/
fetch (url, options) {
return fetch(url, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.