I try add configService
to JwtStrategy:
constructor(readonly configService: ConfigService) {
super({
//...
secretOrKey: this.configService.get('SECRET_KEY'),
});
}
I'm using this instruction. But TS return me error:
'super' must be called before accessing 'this' in the constructor of a derived class.
When I remove this
(like in this answer), then Nest return another error:
Nest can't resolve dependencies of the JwtStrategy (?). Please make sure that the argument ConfigService at index [0] is available in the AuthModule context.