summaryrefslogtreecommitdiff
path: root/lib/json_web_token
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-29 07:37:08 -0800
committerStan Hu <stanhu@gmail.com>2018-12-29 07:37:08 -0800
commitc6d7130f65e89f659ffd905d8b3b6be4df91a0e2 (patch)
tree4e2e654d3432911078a060f72cef4c1bda534ed0 /lib/json_web_token
parent34f51dee0d336487a3fac0946eb198bb5996368b (diff)
downloadgitlab-ce-c6d7130f65e89f659ffd905d8b3b6be4df91a0e2.tar.gz
Set typ field in JSONWebToken::RSAToken
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/rsa_token.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/json_web_token/rsa_token.rb b/lib/json_web_token/rsa_token.rb
index 160e1e506f1..bcce811cd28 100644
--- a/lib/json_web_token/rsa_token.rb
+++ b/lib/json_web_token/rsa_token.rb
@@ -11,7 +11,8 @@ module JSONWebToken
def encoded
headers = {
- kid: kid
+ kid: kid,
+ typ: 'JWT'
}
JWT.encode(payload, key, 'RS256', headers)
end