devise-jwt 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +15 -2
- data/devise-jwt.gemspec +1 -1
- data/lib/devise/jwt/defaults_generator.rb +3 -3
- data/lib/devise/jwt/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9129d2a81114b968dc51a11fa2e04aef75b9324f
|
4
|
+
data.tar.gz: 26c8980b2a75ba0f225193cc5cffed9b8bbb9c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e89f30b0eee4ffce4632572a71b6c66a1075ba8e0a20e24bc64c0eb2227c27f4ca5df2af7a25296cccf19edb320cfa18236d4d365bf2f50a37983d6746d71de
|
7
|
+
data.tar.gz: e4838a029bc9e0753ffb6cd49bf9cdeb50ea88f0c7a909b43e6e60a8e7ecb87639058199350d04d0fbb876db923cdf0e13d0f27bc4c431ffb081a7e02bbd3c68
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [0.4.4] - 2017-12-04
|
8
|
+
### Fixed
|
9
|
+
- Configure classes as strings to avoid problems with Rails STI
|
10
|
+
|
7
11
|
## [0.4.3] - 2017-11-23
|
8
12
|
### Fixed
|
9
13
|
- Return `nil` and not raise when user is not found in model
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ You can read about which security concerns this library takes into account and a
|
|
26
26
|
Add this line to your application's Gemfile:
|
27
27
|
|
28
28
|
```ruby
|
29
|
-
gem 'devise-jwt', '~> 0.4.
|
29
|
+
gem 'devise-jwt', '~> 0.4.4'
|
30
30
|
```
|
31
31
|
|
32
32
|
And then execute:
|
@@ -86,7 +86,20 @@ def jwt_payload
|
|
86
86
|
end
|
87
87
|
```
|
88
88
|
|
89
|
-
Note: if you are making cross-domain requests, make sure that you add `Authorization` header to the list of allowed request headers and exposed response headers. You can use something like [rack-cors](https://github.com/cyu/rack-cors) for that
|
89
|
+
Note: if you are making cross-domain requests, make sure that you add `Authorization` header to the list of allowed request headers and exposed response headers. You can use something like [rack-cors](https://github.com/cyu/rack-cors) for that, for example:
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
config.middleware.insert_before 0, Rack::Cors do
|
93
|
+
allow do
|
94
|
+
origins 'http://your.frontend.domain.com'
|
95
|
+
resource '/api/*',
|
96
|
+
headers: %w(Authorization),
|
97
|
+
methods: :any,
|
98
|
+
expose: %w(Authorization),
|
99
|
+
max_age: 600
|
100
|
+
end
|
101
|
+
end
|
102
|
+
```
|
90
103
|
|
91
104
|
### Revocation strategies
|
92
105
|
|
data/devise-jwt.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_dependency 'devise', '~> 4.0'
|
25
|
-
spec.add_dependency 'warden-jwt_auth', '~> 0.2.
|
25
|
+
spec.add_dependency 'warden-jwt_auth', '~> 0.2.1'
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.12"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -45,14 +45,14 @@ module Devise
|
|
45
45
|
def add_mapping(inspector)
|
46
46
|
scope = inspector.scope
|
47
47
|
model = inspector.model
|
48
|
-
defaults[:mappings][scope] = model
|
48
|
+
defaults[:mappings][scope] = model.name
|
49
49
|
end
|
50
50
|
|
51
51
|
# :reek:FeatureEnvy
|
52
52
|
def add_revocation_strategy(inspector)
|
53
53
|
scope = inspector.scope
|
54
|
-
|
55
|
-
defaults[:revocation_strategies][scope] =
|
54
|
+
strategy = inspector.model.jwt_revocation_strategy
|
55
|
+
defaults[:revocation_strategies][scope] = strategy.name
|
56
56
|
end
|
57
57
|
|
58
58
|
def add_dispatch_requests(inspector)
|
data/lib/devise/jwt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Busqué
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.2.
|
33
|
+
version: 0.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: 0.2.
|
40
|
+
version: 0.2.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|