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 +4 -4
- data/lib/jwt_keeper/token.rb +5 -2
- data/lib/jwt_keeper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26a338e78f6af549348419350f802cb0eea3afead33d967eef694d2e45850faf
|
4
|
+
data.tar.gz: '081c9b805dd36d5a2650faa693ad73b54583a132827fdf490a349c970482f0f5'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7168ef5c0ad904a0cedf95da5b9a2e934e322af10327637bde820298ea21209f4c62104f05a2e6153d6a498aa715340a926d294e6d0d7302f67b559112e600c
|
7
|
+
data.tar.gz: d94f5e45932d679718e5ee5e6d810fa6c4ea3fe037f5bad3629a9719b7d748da7a62d54ed1782715f84e50a85e5bbc5f96ca20211ace602442bd124f1ca6f8d6
|
data/lib/jwt_keeper/token.rb
CHANGED
@@ -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(
|
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
|
)
|
data/lib/jwt_keeper/version.rb
CHANGED
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.
|
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:
|
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.
|
252
|
+
rubygems_version: 3.2.3
|
253
253
|
signing_key:
|
254
254
|
specification_version: 4
|
255
255
|
summary: JWT for Rails made easy
|