devise-jwt 0.5.5 → 0.5.6

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
  SHA1:
3
- metadata.gz: 57b63a9ada186b91ddf11b892501aabae2f4492d
4
- data.tar.gz: fa3f300ec74e2486c89a8c1a43ddd5e2cf7de9dd
3
+ metadata.gz: a1dcf5432b3eca3682d6eda74ea8659a4de99692
4
+ data.tar.gz: 98ca51ba3d3e16558f3e2690504f517fffe45b73
5
5
  SHA512:
6
- metadata.gz: a3266cc44d2018dba06637e32ddc38c7d03a10d51db4c2417e3c4fd7efa4972bbc62e85176fab2b69aadebf5be34ade00685d32f08e609c0782fa16b288db74d
7
- data.tar.gz: 6b633a9f667ee171e4b7c874ccbd321959b91c3581cc92c63a2d599ac9aa67db4eaff2088d5b3c0d725b3498fa6fc480917af85509785dae1d4f4ef1419baa42
6
+ metadata.gz: 5f4a10c20c6dd4638f7fdf661f7715d93a7337dc1e7458f507a2c0f0dcebc80ca58108783a2ded9cbf3c6efda25773e6ce8916a17029b542726ea512eb2ce161
7
+ data.tar.gz: 930058ffefc9dfcfcf47143fbbb27cc81ad10e5528ec99e860d8d0e64ee144fee8b0ed5684ade1f83f28fe1e397cc9a63038ff77f0c5acb0058583bc08634754
@@ -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.5.6] - 2018-02-22
8
+ ### Fixed
9
+ - Work with more than one `sign_out_via` configured
10
+
7
11
  ## [0.5.5] - 2018-01-30
8
12
  ### Fixed
9
13
  - Update `warden-jwt_auth` dependency to reenable JWT scopes being stored to
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.5.5'
29
+ gem 'devise-jwt', '~> 0.5.6'
30
30
  ```
31
31
 
32
32
  And then execute:
@@ -90,15 +90,18 @@ module Devise
90
90
  # :reek:FeatureEnvy
91
91
  def requests(inspector, name)
92
92
  path = inspector.path(name)
93
- method = inspector.method(name)
94
- inspector.formats.map do |format|
95
- request_for_format(path, method, format)
93
+ methods = inspector.methods(name)
94
+ inspector.formats.each_with_object([]) do |format, requests|
95
+ requests.push(*requests_for_format(path, methods, format))
96
96
  end
97
97
  end
98
98
 
99
- def request_for_format(path, method, format)
99
+ # :reek:UtilityFunction
100
+ def requests_for_format(path, methods, format)
100
101
  path_regexp = format ? /^#{path}.#{format}$/ : /^#{path}$/
101
- [method, path_regexp]
102
+ methods.map do |method|
103
+ [method, path_regexp]
104
+ end
102
105
  end
103
106
  end
104
107
  end
@@ -36,15 +36,13 @@ module Devise
36
36
  end
37
37
 
38
38
  # :reek:ControlParameter
39
- def method(name)
40
- case name
41
- when :sign_in
42
- 'POST'
43
- when :sign_out
44
- sign_out_via.to_s.upcase
45
- when :registration
46
- 'POST'
47
- end
39
+ def methods(name)
40
+ method = case name
41
+ when :sign_in then 'POST'
42
+ when :sign_out then sign_out_via
43
+ when :registration then 'POST'
44
+ end
45
+ Array(method)
48
46
  end
49
47
 
50
48
  def formats
@@ -65,7 +63,9 @@ module Devise
65
63
  end
66
64
 
67
65
  def sign_out_via
68
- mapping.sign_out_via.to_s.upcase
66
+ Array(mapping.sign_out_via).map do |method|
67
+ method.to_s.upcase
68
+ end
69
69
  end
70
70
 
71
71
  def default_formats
@@ -17,7 +17,7 @@ module Devise
17
17
  # @param aud [String] The aud claim. If `nil` it will be autodetected from
18
18
  # the header name configured in `Devise::JWT.config.aud_header`.
19
19
  #
20
- # :reek:LongParemeterList
20
+ # :reek:LongParameterList
21
21
  def self.auth_headers(headers, user, scope: nil, aud: nil)
22
22
  scope ||= Devise::Mapping.find_scope!(user)
23
23
  aud ||= headers[Warden::JWTAuth.config.aud_header]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Devise
4
4
  module JWT
5
- VERSION = '0.5.5'
5
+ VERSION = '0.5.6'
6
6
  end
7
7
  end
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.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Busqué
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise