1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src/lib/middleware/oss-authentication.ts
2023-04-06 11:46:54 +02:00

20 lines
501 B
TypeScript

import { Application } from 'express';
import authorizationMiddleware from './authorization-middleware';
import { LogProvider } from '../logger';
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;