fix(core): Update frontend urls when using the --tunnel option (#6898)

fix(core): update frontend urls when using the `--tunnel` option
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-08-09 19:07:45 +02:00 committed by GitHub
parent d71af4059b
commit 718e61354d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(),