summaryrefslogtreecommitdiff
path: root/lib/json_web_token
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-29 00:07:45 -0800
committerStan Hu <stanhu@gmail.com>2018-12-29 00:07:45 -0800
commit1aa420a1fd163ed7c61c4d7f103059a38dcb6a18 (patch)
treedc1f70d8242f0c934c585671e293c3daee1942c2 /lib/json_web_token
parent3648e280baa04112ab0052d991d1f16e86499a5b (diff)
downloadgitlab-ce-1aa420a1fd163ed7c61c4d7f103059a38dcb6a18.tar.gz
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