Adding option to skip token validation.
Looks for skipVerify in options.
jwtAuth({
secret: yoursupersecret,
skipVerify: true
})
Appends unverified: true to decoded token data (saved to req.user by default).
Resolves #183
Are there any plans to get this merged? This would be very useful for automated testing.
In our platform we verify the access token in our API Gateway and then upstream services merely need to decode the token to read the claims, so this PR would be really useful...but I'm guessing this isn't going to get merged given it's been 2.5 years?
Sorry about the very LONG LONG delay... I feel this is not the purpose of this middleware. I'd rather recommend something with jwt-decode as follows:
const decodeMiddleware = (req, res, next) => {
const token = req.headers['authorization'].replace(/Bearer\s/i, '');
req.auth = jwtDecode(token);
next();
}