Jwt Nestjs v5.0.0 passport影响所有路线

Jwt Nestjs v5.0.0 passport影响所有路线,jwt,passport.js,nestjs,Jwt,Passport.js,Nestjs,我正在更新我的代码到v5,我想有一个病房,影响到所有路线,因为我在我的上一个代码,但我不知道如何在新版本中做到这一点。我附上我的旧代码 @Module({ components: [AuthService, JwtStrategy, Config], controllers: [AuthenticateController], }) export class AuthModule implements NestModule {

我正在更新我的代码到v5,我想有一个病房,影响到所有路线,因为我在我的上一个代码,但我不知道如何在新版本中做到这一点。我附上我的旧代码

    @Module({
        components: [AuthService, JwtStrategy, Config],
        controllers: [AuthenticateController],
    })
    
    export class AuthModule implements NestModule {
        

public configure(consumer: MiddlewaresConsumer) {
        consumer
            .apply(passport.authenticate('jwt', { session: false }))
            .forRoutes({ path: '*', method: RequestMethod.ALL });
    }
}
问题的解决办法是什么