1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-17 00:50:05 +00:00

Merge branch 'axios-fetch' of https://github.com/sasjs/adapter into axios-fetch

This commit is contained in:
Krishna Acondy
2021-02-06 13:00:31 +00:00

View File

@@ -670,7 +670,7 @@ export class SASViyaApiClient {
clientSecret: string, clientSecret: string,
authCode: string, authCode: string,
insecure: boolean = false insecure: boolean = false
) { ): Promise<SasAuthResponse> {
const url = this.serverUrl + '/SASLogon/oauth/token' const url = this.serverUrl + '/SASLogon/oauth/token'
let token let token
if (typeof Buffer === 'undefined') { if (typeof Buffer === 'undefined') {
@@ -694,14 +694,14 @@ export class SASViyaApiClient {
} }
const authResponse = await this.requestClient const authResponse = await this.requestClient
.post<SasAuthResponse>( .post(
url, url,
formData, formData,
undefined, undefined,
'multipart/form-data; boundary=' + (formData as any)._boundary, 'multipart/form-data; boundary=' + (formData as any)._boundary,
headers headers
) )
.then((res) => res.result) .then((res) => res.result as SasAuthResponse)
return authResponse return authResponse
} }