Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
fix: send code redeeming requests using url-encoded form data
Browse files Browse the repository at this point in the history
  • Loading branch information
noramass committed May 7, 2021
1 parent 172a013 commit d1c123b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ export class AuthClient {
scope?: string
): Promise<JwtResponseBundle> {
const payload = { code, grant_type: grantType, redirect_url: redirectUrl, client_id: clientId, scope };
return this.api.post("/oauth/token", payload, { baseURL: this.baseUrl }).then((r) => r.data);
const requestConfig = { baseURL: this.baseUrl, headers: { "Content-Type": "application/x-www-form-urlencoded" } };
return this.api.post("/oauth/token", payload, requestConfig).then((r) => r.data);
}

public authHeader(token: string): AxiosRequestConfig {
Expand Down

0 comments on commit d1c123b

Please sign in to comment.