devise-jwt-cookie 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/devise/jwt/cookie/middleware.rb +9 -1
- data/lib/devise/jwt/cookie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7c6ec8c992497fb3b8b101513715de4316b61085cb32392e40d869016e90f06
|
4
|
+
data.tar.gz: 1530836791408926eaa4e7c955248b9aabda65d8d9b5e694492350e8113ca2c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aec5355a7c0b152a3e67d7756a8b6f29969f072f939ca248c3d98d52505d4544a2e1426a6fc93fb1fbdcbb741f1699305a6c3eeba57f99897eeb581a5e5b025
|
7
|
+
data.tar.gz: 2a5640bc4e58fa33c4deebed85553ab0f4d568dfb32ca06aa24929ea093e33ec97ac3c8d77f8b4c85e9b2a9cc13df3f9e913acae1815a8776bcacb82878b0a87
|
data/README.md
CHANGED
@@ -12,11 +12,19 @@ module Devise
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
+
token_should_be_revoked = token_should_be_revoked?(env)
|
16
|
+
if token_should_be_revoked
|
17
|
+
# add the Authorization header, devise-jwt needs this to revoke tokens
|
18
|
+
# we need to make sure this is done before the other middleware is run
|
19
|
+
request = ActionDispatch::Request.new(env)
|
20
|
+
env['HTTP_AUTHORIZATION'] = "Bearer #{CookieHelper.new.read_from(request.cookies)}"
|
21
|
+
end
|
22
|
+
|
15
23
|
status, headers, response = app.call(env)
|
16
24
|
if headers['Authorization'] && env[ENV_KEY]
|
17
25
|
name, cookie = CookieHelper.new.build(env[ENV_KEY])
|
18
26
|
Rack::Utils.set_cookie_header!(headers, name, cookie)
|
19
|
-
elsif token_should_be_revoked
|
27
|
+
elsif token_should_be_revoked
|
20
28
|
name, cookie = CookieHelper.new.build(nil)
|
21
29
|
Rack::Utils.set_cookie_header!(headers, name, cookie)
|
22
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-jwt-cookie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niels van der Zanden
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise-jwt
|