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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f935cdba94a1ee6346d98bbd477efa309b737202af1c37a15ef40dda4ff9c904
4
- data.tar.gz: 3429e3acc2aca830d3d5b615b92b9e4c6155fb142975344a01185dce1a014176
3
+ metadata.gz: dcfcb293a7247a05c7eda81e7601ee8f446da97cdaaa841cbd0b6e631d850937
4
+ data.tar.gz: 6d427bf1fb3ff4e193972873f8ebc1d4d04a8e5f0baac3b3fe57f1d4f53f7a69
5
5
  SHA512:
6
- metadata.gz: 543fb3129587449fb606083ea162fd61e041cbe7d0769e77103b58fd49f3ede0c2cf1e66e2c0c5b745d41e45ab474fdfeb79c30df001a4ae07eeb9be066ddca8
7
- data.tar.gz: 64ab16a0072ab1170f461075729e866dac1aca34e61894fa6ce6ff7ed06e46e17b4fddf08461c6f1114652e1507f499272c75ee96c1f429ee44c56a2bffa4f18
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
@@ -1,7 +1,7 @@
1
1
  module Warden
2
2
  module CookieSession
3
3
 
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.2'.freeze
5
5
 
6
6
  end
7
7
  end
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.1.19161
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-14 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler