Skip to content

Commit

Permalink
update docs to make it clear how to disable expiration claim verifica…
Browse files Browse the repository at this point in the history
…tion and not before verification which are enabled by default
  • Loading branch information
yasonk authored and anakinj committed Feb 4, 2021
1 parent cba7d08 commit 9d88f62
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d88f62

Please sign in to comment.