Skip to content

Commit

Permalink
documenting calling verify_jti callback with 2 arguments in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck authored and anakinj committed Feb 4, 2021
1 parent bb45d5a commit 6ff11dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -424,6 +424,8 @@ begin
#decoded_token = JWT.decode token, hmac_secret, true, { verify_jti: true, algorithm: 'HS256' }
# Alternatively, pass a proc with your own code to check if the JTI has already been used
decoded_token = JWT.decode token, hmac_secret, true, { verify_jti: proc { |jti| my_validation_method(jti) }, algorithm: 'HS256' }
# or
decoded_token = JWT.decode token, hmac_secret, true, { verify_jti: proc { |jti, payload| my_validation_method(jti, payload) }, algorithm: 'HS256' }
rescue JWT::InvalidJtiError
# Handle invalid token, e.g. logout user or deny access
puts 'Error'
Expand Down

0 comments on commit 6ff11dc

Please sign in to comment.