fix(auth): fix global prefix exclusion for OIDC routes

Add explicit path exclusions and path-to-regexp wildcard patterns
to ensure /api/auth/jwks and other OIDC routes are excluded from
the /api/v1 global prefix. This fixes JWKS endpoint accessibility
for Matrix Synapse OIDC integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-29 12:31:25 +01:00
parent e46a4c96df
commit 42dafe593b

View file

@ -86,9 +86,15 @@ async function bootstrap() {
exclude: [
{ path: 'metrics', method: RequestMethod.ALL },
{ path: 'health', method: RequestMethod.ALL },
// Better Auth routes - use path-to-regexp wildcards
{ path: 'api/auth/(.*)', method: RequestMethod.ALL },
{ path: 'api/auth/jwks', method: RequestMethod.ALL },
{ path: 'api/auth/:path*', method: RequestMethod.ALL },
// OIDC routes
{ path: '.well-known/(.*)', method: RequestMethod.ALL },
{ path: '.well-known/openid-configuration', method: RequestMethod.ALL },
{ path: 'api/oidc/(.*)', method: RequestMethod.ALL },
{ path: 'api/oidc/:path*', method: RequestMethod.ALL },
],
});