Since I upgraded to jwt 4, it doesn't work anymore. I manage to login but when I try to access to the secured route, I directly go into the "secured" function, and the middleware is never called...
A clue?
app.use(passport.initialize());
const jwtstrategy = new JWTStrategy(
{
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: __JWT__,
passReqToCallback: true
},
async (req: Request, payload: AuthenticationPayload, done) => {
console.log('>>>> SHOULD PASS HERE BUT DOESN'T !!!!!!!!');
}
)
Hello,
Here is my code, maybe I do it wrong?
Since I upgraded to jwt 4, it doesn't work anymore. I manage to login but when I try to access to the secured route, I directly go into the "secured" function, and the middleware is never called...
A clue?