Skip to content

Commit

Permalink
fix(core): update oauth endpoints to use instance base url
Browse files Browse the repository at this point in the history
  • Loading branch information
freya authored Sep 14, 2022
1 parent 461848f commit dd3ba96
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'),
Expand Down

0 comments on commit dd3ba96

Please sign in to comment.