我一直在关注 jwt 示例,例如https://docs.nestjs.com/techniques/authentication。我复制并粘贴了示例。在 npm 安装必要的位和 bops 后,我得到了这个错误,这在我刚刚复制的示例中没有发生。我不知道这意味着什么!有人有什么想法吗?
TypeError: Class constructor MixinStrategy cannot be invoked without 'new'
8 | export class JwtStrategy extends PassportStrategy(Strategy) {
9 | constructor(private readonly authService: AuthService) {
> 10 | super({
11 | jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
12 | secretOrKey: 'secretKey',
13 | });
at new JwtStrategy (data/auth/strategies/jwt.strategy.ts:10:5)
at resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:64:84)
at Injector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:86:30)