-
Notifications
You must be signed in to change notification settings - Fork 376
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
verify takes 2 params, second being payload closes: #207 #238
Conversation
lib/jwt/verify.rb
Outdated
@@ -63,7 +63,11 @@ def verify_jti | |||
jti = @payload['jti'] | |||
|
|||
if options_verify_jti.respond_to?(:call) | |||
raise(JWT::InvalidJtiError, 'Invalid jti') unless options_verify_jti.call(jti) | |||
raise(JWT::InvalidJtiError, 'Invalid jti') unless ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use parentheses around the condition of an unless
.
lib/jwt/verify.rb
Outdated
@@ -63,7 +63,11 @@ def verify_jti | |||
jti = @payload['jti'] | |||
|
|||
if options_verify_jti.respond_to?(:call) | |||
raise(JWT::InvalidJtiError, 'Invalid jti') unless options_verify_jti.call(jti) | |||
raise(JWT::InvalidJtiError, 'Invalid jti') unless ( | |||
options_verify_jti.arity == 2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid multi-line ternary operators, use if
or unless
instead.
70ee808
to
bb31372
Compare
bb31372
to
e348ee3
Compare
@ab320012 Thanks for the PR! |
@excpt Thanks Tim! |
Added optional payload to verify_jti + passing tests for payload and arguements #207