1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

fix: bearer tokens with base-path (#7065)

## About the changes
We've identified that Bearer token middleware is not working for
/enterprise instance.

Looking at a few lines below:
88e3b1b79e/src/lib/app.ts (L81-L84)
we can see that we were missing the basePath in the use definition.
This commit is contained in:
Gastón Fournier 2024-05-16 11:45:16 +02:00 committed by GitHub
parent 88e3b1b79e
commit 7cf9cfa96e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,7 @@ export default async function getApp(
app.use(requestLogger(config));
app.use('/api', bearerTokenMiddleware(config)); // We only need bearer token compatibility on /api paths.
app.use(`${baseUriPath}/api`, bearerTokenMiddleware(config)); // We only need bearer token compatibility on /api paths.
if (typeof config.preHook === 'function') {
config.preHook(app, config, services, db);