Skip to content

Commit

Permalink
add notes about custom header support
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Jun 21, 2019
1 parent 4dd0e8b commit cde3031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit cde3031

Please sign in to comment.