jwt_token_auth 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bdf2e87a6aa52c9c287da67c98c88c25aa478b7
4
- data.tar.gz: da86cea6864ee78270bfd22e9738395127240988
3
+ metadata.gz: 7297b79b01641fe23f37feeb39669506d9635117
4
+ data.tar.gz: f2fb74ced7406386bf03771f2edd7eb34a2ad8c8
5
5
  SHA512:
6
- metadata.gz: 30a5f9b41889d643d930881d0ae7a54da7e883eb1ded1ef6e5415e5a892cc414329d666303533aa8dbb65f1e7e13b35ad9a39b49bdd1fbc44ece6f3e686fe33e
7
- data.tar.gz: 78c58ffbdc9d187fecebb6c85c16c00838589741a8d6ed84921bf0f680d2afa074ae7b152e460afd299e3ad6ada8dbf0746b01140cf6c7dab1c6b550df41841e
6
+ metadata.gz: ace5bd9614c7033573d85070bc536c7995195d9e74641631150541a8519f9199766ffe38545b57b6b357e46ea1bc509c86fa99e1f3b9b3df63b982f215366b2d
7
+ data.tar.gz: fdea9d9d50e6ff6ea0071eac0382a9bdfdbe51c8dacb1f0a6f898d8161bc36f333cd5e7027257bcd1c59c0331bbd782918f6ff462cccf1f277eef31c6b6b4149
@@ -20,18 +20,17 @@ module JwtTokenAuth
20
20
  claims :iss, :sub, :aud, :exp, :nbf, :iat, :jti
21
21
 
22
22
  def initialize(params = {})
23
- params = convert_keys_into_symbols(params)
23
+ params = {
24
+ exp: Time.new.to_i + JwtTokenAuth.configuration.expiration_time,
25
+ iat: Time.now.to_i
26
+ }.merge(convert_keys_into_symbols(params))
24
27
 
25
28
  @iss = params[:iss]
26
29
  @sub = params[:sub]
27
30
  @aud = params[:aud]
28
- @exp = params.fetch :exp do
29
- time = JwtTokenAuth.configuration.expiration_time.call().to_i
30
- end.tap { |time| params[:exp] = time }
31
+ @exp = params[:exp]
31
32
  @nbf = params[:nbf]
32
- @iat = params.fetch :iat do
33
- Time.now.to_i
34
- end.tap { |time| params[:iat] = time }
33
+ @iat = params[:iat]
35
34
  @jti = params[:jti]
36
35
 
37
36
  __setobj__(params)
@@ -4,7 +4,7 @@ module JwtTokenAuth
4
4
 
5
5
  def initialize
6
6
  @secret = "supersecret"
7
- @expiration_time = proc { Time.now + (60 * 60) }
7
+ @expiration_time = 86400
8
8
  end
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module JwtTokenAuth
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristopher Bredemeier
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.4.5
140
+ rubygems_version: 2.4.6
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: JWT Token Authemtication