From 9d88f62760da4bfa837d1ad96e047d6d104f325d Mon Sep 17 00:00:00 2001 From: Yason Khaburzaniya Date: Wed, 3 Feb 2021 19:20:37 -0800 Subject: [PATCH] update docs to make it clear how to disable expiration claim verification and not before verification which are enabled by default --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 85b4cd48..0bf6a954 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,12 @@ rescue JWT::ExpiredSignature end ``` +The Expiration Claim verification can be disabled. +```ruby +# Decode token without raising JWT::ExpiredSignature error +JWT.decode token, hmac_secret, true, { verify_expiration: false, algorithm: 'HS256' } +``` + **Adding Leeway** ```ruby @@ -331,6 +337,12 @@ rescue JWT::ImmatureSignature end ``` +The Not Before Claim verification can be disabled. +```ruby +# Decode token without raising JWT::ImmatureSignature error +JWT.decode token, hmac_secret, true, { verify_not_before: false, algorithm: 'HS256' } +``` + **Adding Leeway** ```ruby