mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
🐛 Update salesforce node's get subdomain function (#834)
Original function will not match subdomains like `https://a.b.c.salesforce.com` and use regular expression to get the subdomain.
This commit is contained in:
parent
520933c7a4
commit
4b8c6147d3
|
@ -10,7 +10,7 @@ import {
|
||||||
|
|
||||||
export async function salesforceApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
export async function salesforceApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||||
const credentials = this.getCredentials('salesforceOAuth2Api');
|
const credentials = this.getCredentials('salesforceOAuth2Api');
|
||||||
const subdomain = (credentials!.accessTokenUrl as string).split('.')[0].split('/')[2];
|
const subdomain = ((credentials!.accessTokenUrl as string).match(/https:\/\/(.+).salesforce\.com/) || [])[1]
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
method,
|
method,
|
||||||
body,
|
body,
|
||||||
|
|
Loading…
Reference in a new issue