From 3d4f234a00771322d049a21a38441b0a07cd79fe Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Tue, 28 Mar 2023 16:05:02 -0400 Subject: [PATCH] fix: should call oauth login with correct route Fixes #99 --- .../oauth-client-credentials-api-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/client/oauth-client-credentials-api-client/oauth-client-credentials-api-client.ts b/src/common/client/oauth-client-credentials-api-client/oauth-client-credentials-api-client.ts index 62fc9bb..eb7870a 100644 --- a/src/common/client/oauth-client-credentials-api-client/oauth-client-credentials-api-client.ts +++ b/src/common/client/oauth-client-credentials-api-client/oauth-client-credentials-api-client.ts @@ -29,7 +29,7 @@ export class OAuthClientCredentialsClient implements ApiClient { } async login(): Promise> { - const url = `${this._host}/oauth2/authorize`; + const route = '/oauth2/authorize'; const method = 'POST'; const body = this.createFormData(); body.append('grant_type', 'client_credentials'); @@ -42,7 +42,7 @@ export class OAuthClientCredentialsClient implements ApiClient { duplex: 'half' } as RequestInit; - const response = await this.fetch(url, request); + const response = await this.fetch(route, request); const responseJson = await response.json(); if ((responseJson as ErrorResponse).error === 'invalid_client') {