jwt_keeper 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e0b54e0b218b816c8bd261c723ec33c054d085ef521d0dbe145cbc51ae9805c
4
- data.tar.gz: 30b605d2628612a0810897528ea73d8fbf907d15d59cb01f7172bd282382ac00
3
+ metadata.gz: 26a338e78f6af549348419350f802cb0eea3afead33d967eef694d2e45850faf
4
+ data.tar.gz: '081c9b805dd36d5a2650faa693ad73b54583a132827fdf490a349c970482f0f5'
5
5
  SHA512:
6
- metadata.gz: 8caacceede25c63e353a17ab39bed5b06581e2013c66ca9af22c29b312a61fc7fff079e270befadaaaf5a8488d64a1851344a9609b5b1335a81d15358cda2756
7
- data.tar.gz: 22ade2f9b71c1cf0eed4f15967cde19731c533002445e3fefd2013838a1ef4628071c9ce72b8dd600d75d3f9f1b37160ea35dc225a96eebb396cdf10f3cc14d7
6
+ metadata.gz: f7168ef5c0ad904a0cedf95da5b9a2e934e322af10327637bde820298ea21209f4c62104f05a2e6153d6a498aa715340a926d294e6d0d7302f67b559112e600c
7
+ data.tar.gz: d94f5e45932d679718e5ee5e6d810fa6c4ea3fe037f5bad3629a9719b7d748da7a62d54ed1782715f84e50a85e5bbc5f96ca20211ace602442bd124f1ca6f8d6
@@ -15,6 +15,7 @@ module JWTKeeper
15
15
  iat: DateTime.now.to_i, # issued at
16
16
  jti: SecureRandom.uuid # JWT ID
17
17
  }
18
+
18
19
  @claims.merge!(JWTKeeper.configuration.base_claims)
19
20
  @claims.merge!(private_claims)
20
21
  @claims[:exp] = @claims[:exp].to_i if @claims[:exp].is_a?(Time)
@@ -36,7 +37,9 @@ module JWTKeeper
36
37
  claims = decode(raw_token, cookie_secret)
37
38
  return nil if claims.nil?
38
39
 
39
- new_token = new(claims, cookie_secret)
40
+ new_token = new({}, cookie_secret)
41
+ new_token.claims = claims
42
+
40
43
  return nil if new_token.revoked?
41
44
  new_token
42
45
  end
@@ -152,7 +155,7 @@ module JWTKeeper
152
155
 
153
156
  # @!visibility private
154
157
  def encode
155
- JWT.encode(claims,
158
+ JWT.encode(claims.compact,
156
159
  JWTKeeper.configuration.secret.to_s + cookie_secret.to_s,
157
160
  JWTKeeper.configuration.algorithm
158
161
  )
@@ -1,4 +1,4 @@
1
1
  # Gem Version
2
2
  module JWTKeeper
3
- VERSION = '4.0.0'.freeze
3
+ VERSION = '4.0.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt_keeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rivera
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-15 00:00:00.000000000 Z
12
+ date: 2021-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
251
  requirements: []
252
- rubygems_version: 3.1.4
252
+ rubygems_version: 3.2.3
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: JWT for Rails made easy