NestJS JwtStrategy use configService to pass secret key

后端 未结 1 1103
忘掉有多难
忘掉有多难 2021-01-14 14:10

I have the JwtStrategy class from docs example (https://docs.nestjs.com/techniques/authentication):

@Injectable()
export class JwtStrategy extends PassportSt         


        
相关标签:
1条回答
  • 2021-01-14 14:49

    Just remove this., see here:

    secretOrKey: configService.getSecretKey
    

    It will work since configService has been passed as a parameter.

    0 讨论(0)
提交回复
热议问题