There is no way to verify the exp claim without verifying the JWT. It would be nice to be able to verify a specific claim.
exp = Time.now.to_i - 4 * 3600
exp_payload = { exp: exp }
token = JWT.encode exp_payload, 'asdf', 'HS256'
# This does not verify the expiration
decoded_token = JWT.decode token, nil, false, { verify_expiration: true }
decoded_token = JWT.decode token, nil, true, { verify_expiration: true }
# => No verification key available (JWT::DecodeError)
There is no way to verify the exp claim without verifying the JWT. It would be nice to be able to verify a specific claim.