mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
20 lines
501 B
TypeScript
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;
|