rails_jwt_auth 0.20.0 → 0.21.0

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: 7a7954b3c32181adbad0fc1353f87503eb3c1a9da366aa57019121249bb0d859
4
- data.tar.gz: dc7d92d0ad939cfc508284986ad11671abe6d8ec1d8ec8476d4ec1d1b9d99468
3
+ metadata.gz: c2d3d72328f4fd09857c817cdcb70aa8950badbdce4f4b24eef9c0c03cd33c40
4
+ data.tar.gz: 6324cd6f9d293b683e273972ab8dafaee11b89f2ffb209ef1574c69c42b9b377
5
5
  SHA512:
6
- metadata.gz: 4d8b93466166a0ecee271dcce19b0bcdfba81006d50f05253120cb8b2605f8c7c35407c994352c2cb7829801e01a297778d01610c3fb32a04e43c71cc17d30cd
7
- data.tar.gz: 1ae8ee7ec75ac8685e64a5662d3372cca533f4a78088fa1ce4d9a1bd0109652e02c88ddb4341238bd3be8d20d65f8401a3e2ea0c5c05b01a09ce99634abcc617
6
+ metadata.gz: b9a3821d06717a9ca57ca1f56358401a67d6028f5b537f0a80c02f39069932754369d1611d26412b7e0762fd0a53ee358321dc3925c54c35f8b4010cbcae3d12
7
+ data.tar.gz: 1f8c0a8a8270bc776b37b4ed8edd00485df3a1693224c81f47dcf735285f3684ff53ad6ae8a0e50cadba84c790e871819e7e1d8478c9bc82a7f81401eee13b6c
@@ -3,16 +3,20 @@ require 'jwt'
3
3
  module RailsJwtAuth
4
4
  module Jwt
5
5
  class Manager
6
+ def self.secret_key_base
7
+ Rails.application.secrets.secret_key_base || Rails.application.credentials.secret_key_base
8
+ end
9
+
6
10
  # Encodes and signs JWT Payload with expiration
7
11
  def self.encode(payload)
8
12
  payload.reverse_merge!(meta)
9
- JWT.encode(payload, Rails.application.secrets.secret_key_base)
13
+ JWT.encode(payload, secret_key_base)
10
14
  end
11
15
 
12
16
  # Decodes the JWT with the signed secret
13
17
  # [{"auth_token"=>"xxx", "exp"=>148..., "iss"=>"RJA"}, {"typ"=>"JWT", "alg"=>"HS256"}]
14
18
  def self.decode(token)
15
- JWT.decode(token, Rails.application.secrets.secret_key_base)
19
+ JWT.decode(token, secret_key_base)
16
20
  end
17
21
 
18
22
  # Validates the payload hash for expiration and meta claims
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAuth
2
- VERSION = '0.20.0'
2
+ VERSION = '0.21.0'
3
3
  end
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rjurado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-16 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: bcrypt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '3.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '3.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: warden
28
+ name: jwt
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: '2.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.2'
40
+ version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: jwt
42
+ name: rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.5'
47
+ version: '5.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.5'
54
+ version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bcrypt
56
+ name: warden
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.1'
61
+ version: '1.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.1'
68
+ version: '1.2'
69
69
  description: Rails authentication solution based on Warden and JWT and inspired by
70
70
  Devise.
71
71
  email: