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 authored Aug 9, 2023
1 parent d71af40 commit 718e613
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 @@ -404,6 +404,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, {
quota: Container.get(License).getUsersLimit(),
Expand Down

0 comments on commit 718e613

Please sign in to comment.