Module to verify JSON Web Tokens.
Decode the JWT and check that it is valid
Decode the JWT and check that it is valid.
As well as checking that the token is a valid JWT, this function also checks that it has a kid value in the header, nbf and exp values in the body, and that it uses a supported algorithm, either HMAC-sha512 or HMAC-sha256.
kid
nbf
exp