You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I instead change the code to do exp_time = (Time.now + 3600).to_i (i.e. cast to Unix epoch), it works correctly and doesn't raise a JWT::ExpiredSignature. The payload generated by that code is obviously different:
{
"data": "test",
"exp": 1462042886
}
So I'm guessing that the decoding is not converting time values like 2016-04-30 13:57:44 -0500 back into Time objects correctly.
Although the examples in the README explicitly do .to_i, it would be nice to either handle other time values or raise an exception if they are not supported at the encoding step.
The text was updated successfully, but these errors were encountered:
If I paste the generated token into jwt.io, this is the payload that
JWT.encode
generated:If I instead change the code to do
exp_time = (Time.now + 3600).to_i
(i.e. cast to Unix epoch), it works correctly and doesn't raise aJWT::ExpiredSignature
. The payload generated by that code is obviously different:So I'm guessing that the decoding is not converting time values like
2016-04-30 13:57:44 -0500
back into Time objects correctly.Although the examples in the README explicitly do
.to_i
, it would be nice to either handle other time values or raise an exception if they are not supported at the encoding step.The text was updated successfully, but these errors were encountered: