mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(cli): include "auth-excluded" endpoints on the history middleware 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.
This commit is contained in:
parent
287533e6c8
commit
d554128457
|
@ -665,8 +665,16 @@ class App {
|
||||||
rewrites: [
|
rewrites: [
|
||||||
{
|
{
|
||||||
from: new RegExp(
|
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) => {
|
to: (context) => {
|
||||||
return context.parsedUrl.pathname!.toString();
|
return context.parsedUrl.pathname!.toString();
|
||||||
|
|
Loading…
Reference in a new issue