The Wayback Machine - https://web.archive.org/web/20220309191943/https://github.com/jwt/ruby-jwt/pull/237
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

simplified logic for keyfinder #237

Merged
merged 1 commit into from Oct 5, 2017
Merged

simplified logic for keyfinder #237

merged 1 commit into from Oct 5, 2017

Conversation

ab320012
Copy link
Contributor

@ab320012 ab320012 commented Sep 19, 2017

was looking into adding docs for keyfinder, realized none of params decode takes are documented but also saw a way to simplify if statement, the tests still pass although i am not sure there is a test with keyfinder, let me know if i need to add one.

lib/jwt.rb Outdated
end
raise JWT::DecodeError, 'No verification key available' unless key
end
key = keyfinder.call(header, payload) if keyfinder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use yield instead of keyfinder.call.

@ab320012 ab320012 force-pushed the keyfinder-simplify branch 2 times, most recently from a87f65f to cb3c2ed Sep 19, 2017
@ab320012 ab320012 force-pushed the keyfinder-simplify branch from cb3c2ed to 9e3d227 Sep 19, 2017
@excpt excpt self-requested a review Oct 5, 2017
excpt
excpt approved these changes Oct 5, 2017
Copy link
Member

@excpt excpt left a comment

A treat for the eyes. Thank you.

@excpt excpt self-assigned this Oct 5, 2017
@excpt excpt added this to the Version 2.1.0 milestone Oct 5, 2017
@excpt excpt merged commit e3116b5 into jwt:master Oct 5, 2017
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants