Мне нужно получить доступ к значению токена внутри функции проверки. Как это сделать. Когда я использую ExtractJwt.fromAuthHeaderAsBearerToken () внутри validate (), он возвращает [Function]
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy)
{
constructor(private userService: UserService, private jwtService: JwtService)
{
super
({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: process.env.JWT_SECRET
});
console.log("asd");
console.log(ExtractJwt.fromAuthHeaderAsBearerToken());
}
async validate(payload: any)
{
/// Need the token's value here. The encoded value and not the decoded one.
}
}