From 7e4cb219de474cc87aa707b02f390f00994e2f70 Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Mon, 25 Jan 2021 13:08:23 +0000 Subject: [PATCH] documenting calling verify_jti callback with 2 arguments in the readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 85b4cd48..30676f49 100644 --- a/README.md +++ b/README.md @@ -412,6 +412,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'