Closed shifatul-i closed 6 years ago
i have same problem, it's seem passport-jwt not recognize the header
@ThunderRoid if you use jwtFromRequest: JwtExtract.fromAuthHeaderAsBearerToken() maybe you should set your header like this -> Authorization: Bearer eyJhb......
@nexig the documentation doesn't say anything about Authorization: Bearer eyJhb......
But I will try it out and let you know. Thank you
@ThunderRoid the readme says:
The scheme of Bearer is like I commented above. Please try it and let me know ;)
It works perfectly now, THANKS so much
But why does the Documentation says.....
'JWT' if no auth schema was specified. Take a look in the function you used which is fromAuthHeaderAsBearerToken() (beaerer schema)
Ah, looks like that bit of the README fell out of date. I will correct this.
I don't know what happened, but my Passport Jwt Auth is not working.
in app.js
NOTE:
console.log("Auth : JwtStrategy");
never gets calledMy Login API
And my Not working Private route
`
I Always receive 401 as a response
URL: http://localhost:5000/users/private
Headers-> Authorization: JWT eyJhb......
Am I doing anything wrong here? Any help is appreciated