Skip to content

Commit

Permalink
fix(core): Update frontend urls when using the --tunnel option (#6898)
Browse files Browse the repository at this point in the history
fix(core): update frontend urls when using the `--tunnel` option
  • Loading branch information
netroy committed Aug 17, 2023
1 parent 8423153 commit ec3c066
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ export class Server extends AbstractServer {
* Returns the current settings for the frontend
*/
getSettingsForFrontend(): IN8nUISettings {
// Update all urls, in case `WEBHOOK_URL` was updated by `--tunnel`
const instanceBaseUrl = getInstanceBaseUrl();
this.frontendSettings.urlBaseWebhook = WebhookHelpers.getWebhookBaseUrl();
this.frontendSettings.urlBaseEditor = instanceBaseUrl;
this.frontendSettings.oauthCallbackUrls = {
oauth1: `${instanceBaseUrl}/${this.restEndpoint}/oauth1-credential/callback`,
oauth2: `${instanceBaseUrl}/${this.restEndpoint}/oauth2-credential/callback`,
};

// refresh user management status
Object.assign(this.frontendSettings.userManagement, {
enabled: isUserManagementEnabled(),
Expand Down

0 comments on commit ec3c066

Please sign in to comment.