Skip to content

Commit

Permalink
fix(cli): include "auth-excluded" endpoints on the history middleware…
Browse files Browse the repository at this point in the history
… as well (#4028)

right now endpoints defined in `N8N_AUTH_EXCLUDE_ENDPOINTS` are skipping the JWT auth, and the history middleware is returning 404 on these urls. This change ensures that these endpoints skip all auth-related middlewares.
  • Loading branch information
netroy committed Sep 5, 2022
1 parent 287533e commit d554128
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,16 @@ class App {
rewrites: [
{
from: new RegExp(
// eslint-disable-next-line no-useless-escape
`^\/(${this.restEndpoint}|healthz|metrics|css|js|${this.endpointWebhook}|${this.endpointWebhookTest})\/?.*$`,
`^/(${[
'healthz',
'metrics',
'css',
'js',
this.restEndpoint,
this.endpointWebhook,
this.endpointWebhookTest,
...excludeEndpoints.split(':'),
].join('|')})/?.*$`,
),
to: (context) => {
return context.parsedUrl.pathname!.toString();
Expand Down

0 comments on commit d554128

Please sign in to comment.