Skip to content

Add support for express v5 #348

@quinarygio

Description

@quinarygio

Add support for Express v5.0

After upgrading to express v5.0.0 the compilation fails with the following error:

app.use(
    /\/((?!healthcheck).)*/, // Token verification activated except for healthcheck request
    expressjwt({
        secret: jwksRsa.expressJwtSecret({
            cache: true,
            rateLimit: true,
            jwksRequestsPerMinute: 5,
            jwksUri: jwksUri
        }) as GetVerificationKey,
        algorithms: ['RS256']
    })
);
 error TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction): Promise<...>; unless: (options: Params) => { ...; }; }' is not assignable to parameter of type 'Application<Record<string, any>>'.
      Type '{ (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction): Promise<...>; unless: (options: Params) => { ...; }; }' is missing the following properties from type 'Application<Record<string, any>>': init, defaultConfiguration, engine, set, and 63 more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions