Currently when a request fails due to no JWT being present it fails using an error in the form new Error("No auth token").
If you want to allow anonymous auth there's no reasonable way to differentiate this failure from a real failure; other then the very bad practice of comparing error.message === 'No auth token'.
Please provide an err.code value for errors created by passport-jwt so they can be explicitly handled.
Currently when a request fails due to no JWT being present it fails using an error in the form
new Error("No auth token")
.If you want to allow anonymous auth there's no reasonable way to differentiate this failure from a real failure; other then the very bad practice of comparing
error.message === 'No auth token'
.Please provide an
err.code
value for errors created by passport-jwt so they can be explicitly handled.