warden-jwt_auth 0.3.3 → 0.3.4

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: 707c2b046b0c4685a5c98b18456c305c1fafd23b
4
- data.tar.gz: 82f98685925f55704ec296b24c0bfe08636951b4
3
+ metadata.gz: 3792baa44346d5f08fdf21da1af6df6e0400ac8e
4
+ data.tar.gz: cae4999199e844a67da81ca6a9c2c1934c97c878
5
5
  SHA512:
6
- metadata.gz: bb23f8f0bca81024fdab60bceaeb5235eb06da768641ff212d84aadb8b9aa557adf6c70f5fa3ed53ccb43eb0287da33b1a5edfbb3282d46b9c3f7a5707e194e1
7
- data.tar.gz: 2035526baabad186a0bb3aadb09ab3379ca0fab48a341b14071de57e5c9a794981596887d3a006376530e7bc861d743d5dd8f5119bd6a93587051367305582b7
6
+ metadata.gz: 3a5685a38e2c21a7d005e57ee5e2b5b73f94eb801118a9faae685e69f5e723e41e27bc17cfdc296f220ec2a5250614f33981ae154b57885ca88fd86507dd3989
7
+ data.tar.gz: aa63cee9efe1e7f4a7f408d0a6257c5fd61d42d19aaf21da700f26bd1c877415548c571cf155182b072981de1096b17683eafb64c3b70045afded744145ec6ce
@@ -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.3.4] - 2018-12-09
8
+ ### Fixed
9
+ - Do not log out from session for standard AJAX requests
10
+
7
11
  ## [0.3.3] - 2017-12-31
8
12
  ### Fixed
9
13
  - Check it is not a html request when disallowing fetching from session
data/README.md CHANGED
@@ -24,7 +24,7 @@ If what you need is a JWT authentication library for [devise](https://github.com
24
24
  ## Installation
25
25
 
26
26
  ```ruby
27
- gem 'warden-jwt_auth', '~> 0.3.3'
27
+ gem 'warden-jwt_auth', '~> 0.3.4'
28
28
  ```
29
29
 
30
30
  And then execute:
@@ -57,14 +57,16 @@ module Warden
57
57
  env[env_name]
58
58
  end
59
59
 
60
- # Returns whether `text/html` is within `Accept` header values
60
+ # Heuristic to determinate whether the request is not meant to be consumed
61
+ # by an API endpoint
61
62
  #
62
63
  # @param env [Hash] Rack env
63
64
  # @return [Boolean]
64
- def self.html_request?(env)
65
+ def self.no_api_request?(env)
65
66
  accept = env['HTTP_ACCEPT']
66
67
  return false unless accept
67
- accept.include?('text/html')
68
+ accept.include?('text/html') ||
69
+ accept.include?('text/javascript')
68
70
  end
69
71
  end
70
72
  end
@@ -43,7 +43,7 @@ module Warden
43
43
  def logout_scope(auth, opts)
44
44
  env = auth.env
45
45
  scope = opts[:scope]
46
- return if !jwt_scope?(scope) || EnvHelper.html_request?(env)
46
+ return if !jwt_scope?(scope) || EnvHelper.no_api_request?(env)
47
47
  auth.logout(scope)
48
48
  end
49
49
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Warden
4
4
  module JWTAuth
5
- VERSION = '0.3.3'
5
+ VERSION = '0.3.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.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-12-31 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable