From cde3031e7c980723eac71954a055503a5635fd2d Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Fri, 21 Jun 2019 14:45:20 +1000 Subject: [PATCH] add notes about custom header support --- CHANGELOG.md | 1 + README.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98eb2cb..49f98fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ #### v1.1.0 2018-06-17 * Adds RSA token support +* Supports specifying custom headers * Supports skipping verification and validation * BREAKING: uses enum to select JWT Algorithm diff --git a/README.md b/README.md index bcfa211..6ad6c27 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ payload = { "foo" => "bar" } token = JWT.encode(payload, "SecretKey", JWT::Algorithm::HS256) # => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIifQ.Y3shN5Wh4FmOPM34biIm9QQmat373hJFKNxgSANQWJo" +# Custom headers +token = JWT.encode(payload, "SecretKey", JWT::Algorithm::HS256, custom: "header") + # Decoding payload, header = JWT.decode(token, "$secretKey", JWT::Algorithm::HS256) # payload = {"foo" => "bar"}