-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Description
I am creating this issue just in case if someone is following the nodejs tutorial on freecodecamp and facing issue while implementing the JWT strategy.
mikenicholson/passport-jwt#153
export class JwtStrategy extends PassportStrategy(Strategy) {
constructor(private configService: ConfigService) {
super({
secretOrKey: configService.get('JWT_SECRET'),
jwtFromRequest: ExtractJwt.fromAuthHeaderWithScheme('Bearer'), //instead of ExtractJwt.fromAuthHeaderAsBearerToken()
ignoreExpiration: true,
});
}
validate(payload: any) {
console.log(payload);
return payload;
}While calling the request you can normally pass Authorization header as Bearer ${token}
Metadata
Metadata
Assignees
Labels
No labels