Method
use
(
req: FastifyRequest['raw'] & { headers: Record<string, unknown> },
res,
next: () => void,
)
Source from the content-addressed store, hash-verified
| 28 | @Injectable() |
| 29 | class AuthMiddleware implements NestMiddleware { |
| 30 | use( |
| 31 | req: FastifyRequest['raw'] & { headers: Record<string, unknown> }, |
| 32 | res, |
| 33 | next: () => void, |
| 34 | ) { |
| 35 | if (req.headers['x-auth'] === '1') { |
| 36 | return next(); |
| 37 | } |
| 38 | res.statusCode = 401; |
| 39 | res.end('unauthorized'); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | @Controller('users') |
Callers
nothing calls this directly
Tested by
no test coverage detected