mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-13 11:17:26 +02:00
We're migrating to ESM, which will allow us to import the latest versions of our dependencies. Co-Authored-By: Christopher Kolstad <chriswk@getunleash.io>
20 lines
517 B
TypeScript
20 lines
517 B
TypeScript
import type { Application } from 'express';
|
|
import authorizationMiddleware from './authorization-middleware.js';
|
|
import type { LogProvider } from '../logger.js';
|
|
|
|
function ossAuthHook(
|
|
app: Application,
|
|
getLogger: LogProvider,
|
|
baseUriPath: string,
|
|
): void {
|
|
app.use(
|
|
`${baseUriPath}/api`,
|
|
authorizationMiddleware(getLogger, baseUriPath),
|
|
);
|
|
app.use(
|
|
`${baseUriPath}/logout`,
|
|
authorizationMiddleware(getLogger, baseUriPath),
|
|
);
|
|
}
|
|
export default ossAuthHook;
|