diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 1a3b95a..3d3d5ab 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -670,7 +670,7 @@ export class SASViyaApiClient { clientSecret: string, authCode: string, insecure: boolean = false - ) { + ): Promise { 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( + .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 }