Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-29 11:07:45 +0300
committerStan Hu <stanhu@gmail.com>2018-12-29 11:07:45 +0300
commit1aa420a1fd163ed7c61c4d7f103059a38dcb6a18 (patch)
treedc1f70d8242f0c934c585671e293c3daee1942c2 /lib/json_web_token
parent3648e280baa04112ab0052d991d1f16e86499a5b (diff)
Add typ header back into JWT payload
ruby-jwt v2.0 removed the `typ` header in https://github.com/jwt/ruby-jwt/commit/cc41d53e00f8cbf015271b53f5ad761bd6ac2312. To ensure tokens don't get marked invalid during an upgrade, add it back to ensure backwards compatibility.
Diffstat (limited to 'lib/json_web_token')
-rw-r--r--lib/json_web_token/hmac_token.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/json_web_token/hmac_token.rb b/lib/json_web_token/hmac_token.rb
index ceb1b9c913f..ec0917ab49d 100644
--- a/lib/json_web_token/hmac_token.rb
+++ b/lib/json_web_token/hmac_token.rb
@@ -18,7 +18,7 @@ module JSONWebToken
end
def encoded
- JWT.encode(payload, secret, JWT_ALGORITHM)
+ JWT.encode(payload, secret, JWT_ALGORITHM, { typ: 'JWT' })
end
private