From 483cbb3b2abd2e3afadc3f814069d8e12bcf812b Mon Sep 17 00:00:00 2001 From: Almeida Date: Fri, 17 Feb 2023 20:18:13 +0000 Subject: [PATCH] fix(oauth2): pass through body (#9106) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/core/src/api/oauth2.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/api/oauth2.ts b/packages/core/src/api/oauth2.ts index b4bf7361b..17a8e9b94 100644 --- a/packages/core/src/api/oauth2.ts +++ b/packages/core/src/api/oauth2.ts @@ -39,6 +39,7 @@ export class OAuth2API { public async tokenExchange(options: RESTPostOAuth2AccessTokenURLEncodedData) { return this.rest.post(Routes.oauth2TokenExchange(), { body: makeURLSearchParams(options), + passThroughBody: true, headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, @@ -54,6 +55,7 @@ export class OAuth2API { public async refreshToken(options: RESTPostOAuth2RefreshTokenURLEncodedData) { return this.rest.post(Routes.oauth2TokenExchange(), { body: makeURLSearchParams(options), + passThroughBody: true, headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, @@ -71,6 +73,7 @@ export class OAuth2API { public async getToken(options: RESTPostOAuth2ClientCredentialsURLEncodedData) { return this.rest.post(Routes.oauth2TokenExchange(), { body: makeURLSearchParams(options), + passThroughBody: true, headers: { 'Content-Type': 'application/x-www-form-urlencoded', },