Great introduction! However I'd like to point out one thing - the standard practice is to send the JWT in the Authorization header as a Bearer token, that is, the value of this header should be Bearer <jwt_here>. Then we can modify the /verify endpoint to check the Authorization header and extract the token by splitting it by space and getting the second value.
Hi Prafful Javare. I know of that, and I made the sample primarily for anyone to understand how to create and verify a JWT using Node.js. Still, I should probably edit and drop this somewhere in the article. Thanks for pointing this out!
Prafful Javare
Software Engineer
Great introduction! However I'd like to point out one thing - the standard practice is to send the JWT in the
Authorizationheader as a Bearer token, that is, the value of this header should beBearer <jwt_here>. Then we can modify the/verifyendpoint to check the Authorization header and extract the token by splitting it by space and getting the second value.