devise-jwt 0.5.7 → 0.5.8

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: ce25f0119df28a2ff0682ec57b228e7cd3d0d24a
4
- data.tar.gz: f86dd338edbeb3e38992d1a3407888405e566a3d
3
+ metadata.gz: 46efde6e95a9ddba08e9fddd4fd941c8fe9e016e
4
+ data.tar.gz: d407e8b630b65416737cb847581e9de9485ff263
5
5
  SHA512:
6
- metadata.gz: d92f20f3d3a4dff6b9eacb4bc2f00633be267e2d0835ed3b50beb22c0c0a720cc9200ca16d9399877927d3249efb43d1644543e9f57496f5107c6351a309dfee
7
- data.tar.gz: 0431acb342abb8d861c9750fa5fa3b121a7b0c05b01ac15bfa407564c0442107f3f93c72ab800da6b86aac7290f377f80a421072b159042fb563664a19cac18e
6
+ metadata.gz: ed2387cf2a8f06571220d684fdd077fc7de1f9529299fd9f5e7c5493a58d57265d6b6d719185ccb542700ab9320ceb8532beb9ed62a790258a66cc94a1c8ab24
7
+ data.tar.gz: 5669e5195cbf8836ce9b650ea3d1c13af79ee5f9daf0ecd14a1929cf5d4283c263bc8ff003f669f644ec737853f6ccf2f31c6ef993d520ccbf96b0d564c273cd
@@ -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.8] - 2018-09-07
8
+ ### Fixed
9
+ - Fix test helper to persist whitelisted tokens.
10
+
7
11
  ## [0.5.7] - 2018-06-22
8
12
  ### Added
9
13
  - Use `primary_key` instead of `id` to fetch resource.
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.7'
29
+ gem 'devise-jwt', '~> 0.5.8'
30
30
  ```
31
31
 
32
32
  And then execute:
@@ -7,6 +7,10 @@ module Devise
7
7
  # Returns headers with a valid token in the `Authorization` header
8
8
  # added.
9
9
  #
10
+ # Side effects could happen if you have implemented
11
+ # `on_jwt_dispatch` method on the user model (as it happens in
12
+ # the whitelist revocation strategy).
13
+ #
10
14
  # Be aware that a fresh copy of `headers` is returned with the new
11
15
  # key/value pair added, instead of modifying given argument.
12
16
  #
@@ -18,12 +22,16 @@ module Devise
18
22
  # the header name configured in `Devise::JWT.config.aud_header`.
19
23
  #
20
24
  # :reek:LongParameterList
25
+ # :reek:ManualDispatch
21
26
  def self.auth_headers(headers, user, scope: nil, aud: nil)
22
27
  scope ||= Devise::Mapping.find_scope!(user)
23
28
  aud ||= headers[Warden::JWTAuth.config.aud_header]
24
- token, _payload = Warden::JWTAuth::UserEncoder.new.call(
29
+ token, payload = Warden::JWTAuth::UserEncoder.new.call(
25
30
  user, scope, aud
26
31
  )
32
+ if user.respond_to?(:on_jwt_dispatch)
33
+ user.on_jwt_dispatch(token, payload)
34
+ end
27
35
  Warden::JWTAuth::HeaderParser.to_headers(headers, token)
28
36
  end
29
37
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Devise
4
4
  module JWT
5
- VERSION = '0.5.7'
5
+ VERSION = '0.5.8'
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.7
4
+ version: 0.5.8
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-06-22 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise