Skip to content

Commit

Permalink
Updating editor url to not append path
Browse files Browse the repository at this point in the history
  • Loading branch information
krynble committed Mar 14, 2022
1 parent 186e987 commit 450508d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/cli/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ const config = convict({
format: String,
default: '',
env: 'N8N_EDITOR_BASE_URL',
doc: 'Public URL where the editor is accessible; path will be concatenated to this base. Also used for emails sent from n8n.',
doc: 'Public URL where the editor is accessible. Also used for emails sent from n8n.',
},

security: {
Expand Down
7 changes: 1 addition & 6 deletions packages/cli/src/UserManagement/UserManagementHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ export async function getInstanceOwner(): Promise<User> {
* Return the n8n instance base URL without trailing slash.
*/
export function getInstanceBaseUrl(): string {
let n8nBaseUrl = getWebhookBaseUrl();

const editorBaseUrl = config.get('editorBaseUrl'); // defaults to empty string
if (editorBaseUrl) {
n8nBaseUrl = editorBaseUrl + config.get('path');
}
const n8nBaseUrl = config.get('editorBaseUrl') || getWebhookBaseUrl();

return n8nBaseUrl.endsWith('/') ? n8nBaseUrl.slice(0, n8nBaseUrl.length - 1) : n8nBaseUrl;
}
Expand Down

0 comments on commit 450508d

Please sign in to comment.