Small improvements to ZohoCRM-Node and OAuth fix

This commit is contained in:
Jan Oberhauser
2020-02-14 18:48:58 -08:00
parent f938693695
commit 6a08fc9da3
6 changed files with 46 additions and 17 deletions

View File

@@ -955,17 +955,14 @@ class App {
let options = {};
// Here we need a variable that can be set on the credentials
// so that base on that include the credentails on the body or
// leave it as default with woukd include the credentails on the header.
// if (thatvariableistrue) {
// options = {
// body: {
// client_id: _.get(oauthCredentials, 'clientId') as string,
// client_secret: _.get(oauthCredentials, 'clientSecret', '') as string,
// },
// }
// }
if (_.get(oauthCredentials, 'authentication', 'header') as string === 'body') {
options = {
body: {
client_id: _.get(oauthCredentials, 'clientId') as string,
client_secret: _.get(oauthCredentials, 'clientSecret', '') as string,
},
};
}
const oAuthObj = new clientOAuth2({
clientId: _.get(oauthCredentials, 'clientId') as string,