mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
* chore(deps): update dependency eslint-config-airbnb-typescript to v16.1.0 * chore: Update a few places with eslint-ignore due to new linter rules for optional parameters Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: sighphyre <liquidwicked64@gmail.com> Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
16 lines
436 B
TypeScript
16 lines
436 B
TypeScript
import { Application } from 'express';
|
|
import NoAuthUser from '../types/no-auth-user';
|
|
|
|
// eslint-disable-next-line
|
|
function noneAuthentication(basePath = '', app: Application): void {
|
|
app.use(`${basePath}/api/admin/`, (req, res, next) => {
|
|
// @ts-ignore
|
|
if (!req.user) {
|
|
// @ts-expect-error
|
|
req.user = new NoAuthUser();
|
|
}
|
|
next();
|
|
});
|
|
}
|
|
export default noneAuthentication;
|