Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for exp claim in payload #164

Merged
merged 1 commit into from
Sep 16, 2016
Merged

Improve error message for exp claim in payload #164

merged 1 commit into from
Sep 16, 2016

Conversation

excpt
Copy link
Member

@excpt excpt commented Sep 16, 2016

A better error message is displayed if a Time object is used for the exp
claim instead of an integer unix time stamp.

Fixes #148.

A better error message is displayed if a Time object is used for the exp
claim instead of an integer unix time stamp.

Fixes #148.
@excpt excpt merged commit 673113d into jwt:master Sep 16, 2016
@mgwidmann
Copy link

This should have never been ported back to 1.5.5 as it is not backwards compatible since the payload object is not guaranteed in any other location to be a Hash object.

Passing in [] or any other object which does not respond to payload['exp'] crashes with:

TypeError: no implicit conversion of String into Integer

i.e. this crashes:

[1] pry(main)> token = JWT.encode ['my-data', {some: 'payload'}], nil, 'none'
TypeError: no implicit conversion of String into Integer
from (pry):2:in `[]'

@tmm1 tmm1 mentioned this pull request Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants