mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(oauth2): pass through body (#9106)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -39,6 +39,7 @@ export class OAuth2API {
|
|||||||
public async tokenExchange(options: RESTPostOAuth2AccessTokenURLEncodedData) {
|
public async tokenExchange(options: RESTPostOAuth2AccessTokenURLEncodedData) {
|
||||||
return this.rest.post(Routes.oauth2TokenExchange(), {
|
return this.rest.post(Routes.oauth2TokenExchange(), {
|
||||||
body: makeURLSearchParams(options),
|
body: makeURLSearchParams(options),
|
||||||
|
passThroughBody: true,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
},
|
},
|
||||||
@@ -54,6 +55,7 @@ export class OAuth2API {
|
|||||||
public async refreshToken(options: RESTPostOAuth2RefreshTokenURLEncodedData) {
|
public async refreshToken(options: RESTPostOAuth2RefreshTokenURLEncodedData) {
|
||||||
return this.rest.post(Routes.oauth2TokenExchange(), {
|
return this.rest.post(Routes.oauth2TokenExchange(), {
|
||||||
body: makeURLSearchParams(options),
|
body: makeURLSearchParams(options),
|
||||||
|
passThroughBody: true,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
},
|
},
|
||||||
@@ -71,6 +73,7 @@ export class OAuth2API {
|
|||||||
public async getToken(options: RESTPostOAuth2ClientCredentialsURLEncodedData) {
|
public async getToken(options: RESTPostOAuth2ClientCredentialsURLEncodedData) {
|
||||||
return this.rest.post(Routes.oauth2TokenExchange(), {
|
return this.rest.post(Routes.oauth2TokenExchange(), {
|
||||||
body: makeURLSearchParams(options),
|
body: makeURLSearchParams(options),
|
||||||
|
passThroughBody: true,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user