Type |聽Version
---|---
Bug | 4.x
My custom AuthenticatedMiddleware makes use of the "@HeaderParams()" decorator. But my Typescript compiler seems to have an issue with it.
src/modules/auth/MyAuthenticatedMiddleware.ts(6,22): error TS2415: Class 'MyAuthenticatedMiddleware' incorrectly extends base class 'AuthenticatedMiddleware'.
Types of property 'use' are incompatible.
Type '(endpoint: any, request: any, next: any, userTokenHeader: any) => Promise<any>' is not assignable to type '(endpoint: EndpointMetadata, request: Request, next: NextFunction) => void'.
Hi @Kapulara,
This is the problem if you inherit your class from the original class. You need to keep the same signature. So the solution is to not inherit your class from the AuthenticatedMiddleware.
Just look the original implementation of the AuthenticatedMiddleware ;). But I think, isn't a problem.
See you,
Romain
Most helpful comment
Hi @Kapulara,
This is the problem if you inherit your class from the original class. You need to keep the same signature. So the solution is to not inherit your class from the AuthenticatedMiddleware.
Just look the original implementation of the AuthenticatedMiddleware ;). But I think, isn't a problem.
See you,
Romain