From dd3ba963723fbdef7d4239f0890c0776bffd062e Mon Sep 17 00:00:00 2001 From: freya Date: Wed, 14 Sep 2022 09:05:31 +0100 Subject: [PATCH] fix(core): update oauth endpoints to use instance base url --- packages/cli/src/Server.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index acd2051e37..b78ce48a65 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -254,6 +254,9 @@ class App { telemetrySettings.config = { key, url }; } + // Define it here to avoid calling the function multiple times + const instanceBaseUrl = getInstanceBaseUrl(); + this.frontendSettings = { endpointWebhook: this.endpointWebhook, endpointWebhookTest: this.endpointWebhookTest, @@ -264,11 +267,11 @@ class App { maxExecutionTimeout: this.maxExecutionTimeout, timezone: this.timezone, urlBaseWebhook, - urlBaseEditor: getInstanceBaseUrl(), + urlBaseEditor: instanceBaseUrl, versionCli: '', oauthCallbackUrls: { - oauth1: `${urlBaseWebhook}${this.restEndpoint}/oauth1-credential/callback`, - oauth2: `${urlBaseWebhook}${this.restEndpoint}/oauth2-credential/callback`, + oauth1: `${instanceBaseUrl}/${this.restEndpoint}/oauth1-credential/callback`, + oauth2: `${instanceBaseUrl}/${this.restEndpoint}/oauth2-credential/callback`, }, versionNotifications: { enabled: config.getEnv('versionNotifications.enabled'),