warden_cookie_session 0.1.0.18558 → 0.1.0.18794

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: f0bf5bd8ef84a06be034fa11e8d4be8a7e9ad05603a4fd36075e25592520ae56
4
- data.tar.gz: 612c6850fcb10d25b670f7eeacc892293ec35f52afaf00cd11ed9024fdda549b
3
+ metadata.gz: fc0f2470690a41a10f7b110f882731d50dddec97ae0566627f4e4a45aab57be4
4
+ data.tar.gz: 5556943e93e496a5b38a3fed0362d7f38e13fe4cce2be8e9bd9498d18415b91a
5
5
  SHA512:
6
- metadata.gz: 2f3b75579a60206611367ac4d44ee6eeb89115e2aaa8fb90c21ea7acedec7f79d66977873aea2407a6919b3d15fafab8eae630174786de18a2d41da3103954cd
7
- data.tar.gz: dc8e96b5794996dec3da7c48fc06f3cbb597dd5bf607544b9c1f4fc135ceeebcc64b8b0b4cfa3b54fa2194ba5c6f71dd3224bef30f9c2e397aad3e4474825da5
6
+ metadata.gz: c4feb3341035efdec5b7c4102c910306f7336843e48649ad92605d54c15068fa212276af441bbd8ca76d9768b0c7f854aa1105d543d4ddc427702585a76e8dab
7
+ data.tar.gz: cb2c1a6e1f154de0acc2607df9469bf966914a4ddc781a2b32e8b93952eca643c3db347e5e3d0d60ccee4e116048b0e49df716cc970f46b4b7346bb3de242d61
@@ -28,7 +28,7 @@ module Warden
28
28
 
29
29
  Warden::Manager.after_set_user do |user, auth, _opts|
30
30
  encrypted_cookie = Warden::CookieSession::Strategy.encrypted_cookie(auth.cookies)
31
- encrypted_cookie.put(config.serialize_record(user))
31
+ encrypted_cookie.put(config.serialize_record(user), domain: auth.request.domain)
32
32
  end
33
33
 
34
34
  Warden::Manager.before_logout do |_user, auth, _opts|
@@ -6,6 +6,7 @@ class Warden::CookieSession::EncryptedCookie
6
6
  @store = store
7
7
  @cookie = cookie
8
8
  @secret = secret
9
+ raise ArgumentError.new('secret must be 32 bytes') if @secret.length != 32
9
10
 
10
11
  @encryptor ||= ActiveSupport::MessageEncryptor.new(secret)
11
12
  end
@@ -17,8 +18,13 @@ class Warden::CookieSession::EncryptedCookie
17
18
  JSON(encryptor.decrypt_and_verify(value))
18
19
  end
19
20
 
20
- def put(data)
21
- store[cookie] = encryptor.encrypt_and_sign(data.to_json)
21
+ def put(data, domain: nil)
22
+ c = {
23
+ value: encryptor.encrypt_and_sign(data.to_json)
24
+ }
25
+ c[:domain] = domain if domain
26
+
27
+ store[cookie] = c
22
28
  end
23
29
 
24
30
  def clear
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.0.18558
4
+ version: 0.1.0.18794
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-01 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler