* Add the context to the request * @param req * @param _res * @param next
( req: ExpressRequest, _res: Response, next: NextFunction, )
| 20 | * @param next |
| 21 | */ |
| 22 | async function contextMiddleware( |
| 23 | req: ExpressRequest, |
| 24 | _res: Response, |
| 25 | next: NextFunction, |
| 26 | ): Promise<void> { |
| 27 | const configuration = await getCachedConfiguration(true); |
| 28 | |
| 29 | (req as ExpressRequestWithContext).ctx = { |
| 30 | configuration, |
| 31 | decodedToken: { |
| 32 | type: "None", |
| 33 | uid: "", |
| 34 | email: "", |
| 35 | }, |
| 36 | }; |
| 37 | |
| 38 | next(); |
| 39 | } |
| 40 | |
| 41 | export default contextMiddleware; |
nothing calls this directly
no test coverage detected