1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-03 02:30:06 +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,
authCode: string,
insecure: boolean = false
) {
): Promise<SasAuthResponse> {
const url = this.serverUrl + '/SASLogon/oauth/token'
let token
if (typeof Buffer === 'undefined') {
@@ -694,14 +694,14 @@ export class SASViyaApiClient {
}
const authResponse = await this.requestClient
.post<SasAuthResponse>(
.post(
url,
formData,
undefined,
'multipart/form-data; boundary=' + (formData as any)._boundary,
headers
)
.then((res) => res.result)
.then((res) => res.result as SasAuthResponse)
return authResponse
}