Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/resources/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ export class Auth extends Resource {
public exchangeCodeForToken(
request: CodeExchangeRequest
): Promise<CodeExchangeResponse> {
if (!request.clientSecret) {
request.clientSecret = this.apiClient.apiKey;
}

return this.apiClient.request<CodeExchangeResponse>({
method: 'POST',
path: makePathParams('/v3/connect/token', {}),
Expand All @@ -70,10 +66,6 @@ export class Auth extends Resource {
public refreshAccessToken(
request: TokenExchangeRequest
): Promise<CodeExchangeResponse> {
if (!request.clientSecret) {
request.clientSecret = this.apiClient.apiKey;
}

return this.apiClient.request<CodeExchangeResponse>({
method: 'POST',
path: makePathParams('/v3/connect/token', {}),
Expand Down
6 changes: 2 additions & 4 deletions tests/resources/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Auth', () => {
});
});

it('should default clientSecret to the API key', async () => {
it('should not include clientSecret in body when not provided', async () => {
const payload: CodeExchangeRequest = {
clientId: 'clientId',
redirectUri: 'https://redirect.uri/path',
Expand All @@ -59,7 +59,6 @@ describe('Auth', () => {
path: '/v3/connect/token',
body: {
clientId: 'clientId',
clientSecret: 'apiKey',
redirectUri: 'https://redirect.uri/path',
code: 'code',
grantType: 'authorization_code',
Expand Down Expand Up @@ -115,7 +114,7 @@ describe('Auth', () => {
});
});

it('should default clientSecret to the API key', async () => {
it('should not include clientSecret in body when not provided', async () => {
const payload: TokenExchangeRequest = {
clientId: 'clientId',
redirectUri: 'https://redirect.uri/path',
Expand All @@ -128,7 +127,6 @@ describe('Auth', () => {
path: '/v3/connect/token',
body: {
clientId: 'clientId',
clientSecret: 'apiKey',
redirectUri: 'https://redirect.uri/path',
refreshToken: 'refreshToken',
grantType: 'refresh_token',
Expand Down
Loading