warden_cookie_session 0.1.1.19161 → 0.1.2.19222
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/warden/cookie_session/strategy.rb +6 -2
- data/lib/warden/cookie_session/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: dcfcb293a7247a05c7eda81e7601ee8f446da97cdaaa841cbd0b6e631d850937
|
4
|
+
data.tar.gz: 6d427bf1fb3ff4e193972873f8ebc1d4d04a8e5f0baac3b3fe57f1d4f53f7a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67c3bd3e5372a80b214fd346ec6da0e234c61286027a3622e57278cb10f469ef805d4a46844ffe0ce26b69978b6ad270ccfd3961302b1743a61f7576f56a1fdb
|
7
|
+
data.tar.gz: c6ac5b0bf1fb734391cb838cdac6f1e2bf6d6215e4e3799fc3d9ed28e1d3ff1e76480d435bfb479f67757b635ef4fffed354fd4c8dcd462e93b03f4016628bf3
|
@@ -3,7 +3,11 @@ require 'warden/cookie_session/encrypted_cookie'
|
|
3
3
|
class Warden::CookieSession::Strategy < ::Warden::Strategies::Base
|
4
4
|
|
5
5
|
def valid?
|
6
|
-
cookies[Warden::CookieSession.config.cookie]
|
6
|
+
@key_salt = cookies[Warden::CookieSession.config.cookie] && encrypted_cookie.get.presence
|
7
|
+
rescue StandardError => e
|
8
|
+
logger.warn "Warden::CookieSession::Strategy#valid? failed: #{e}"
|
9
|
+
logger.debug { e.backtrace }
|
10
|
+
return false
|
7
11
|
end
|
8
12
|
|
9
13
|
def store?
|
@@ -11,7 +15,7 @@ class Warden::CookieSession::Strategy < ::Warden::Strategies::Base
|
|
11
15
|
end
|
12
16
|
|
13
17
|
def authenticate!
|
14
|
-
key, salt = encrypted_cookie.get
|
18
|
+
key, salt = @key_salt || encrypted_cookie.get
|
15
19
|
record = Warden::CookieSession.config.fetch_record(key)
|
16
20
|
success!(record) if record && Warden::CookieSession.config.validate_record(record, salt)
|
17
21
|
rescue StandardError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden_cookie_session
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2.19222
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|