fridge 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 769896062879cb0dc6c7c69f095a5cedab11beaa0c30cb3e302dfc15eb842343
4
- data.tar.gz: 657ca035209d5be3fcb78aaa74cc418bf764726622ccc3d90e0cab900ad4cf13
3
+ metadata.gz: c01604ddabbbd9a954e9fe73e1567aa0232509c30ed09e7694315131e0402abf
4
+ data.tar.gz: fd4199b0194b7a63e7062c630dc9bb58c75eab607e27ebf13d24fe001a654c40
5
5
  SHA512:
6
- metadata.gz: 1500d9599ef57f700c52c2362086a3c9e0ac1853c2182e72e1f24ffe0583ccdc38bcaca4d7c9e53b792d93b164ae7ac1510af721e7b1359e2e07998da44388b2
7
- data.tar.gz: e18539fb6ae2d73dac73005348bc78015dc2a708e6d4e3f10b7b430ed8368f16f73d58d876ca6afdfb3dcf41d41b165d4291eac3ef6cb11c03c61ff87574fc72
6
+ metadata.gz: 2df7422238fac73bb4263af3af697d049b8ae870ed4c1610c40fdde3bcfd422b0cf8ac5f92a3889201b2aec5d222cda04fc49f5ee1797f6a0a2e3ea615094cb7
7
+ data.tar.gz: e11293fdad80f5a7dfa6f6538b244f67ed59fc8e9867dde34c49c1067555936881b4d7b0de9f0ab5910a2a57b6d68dec0bd76462c888f7531c12ccdd6beb5d47
@@ -88,7 +88,7 @@ module Fridge
88
88
  end
89
89
 
90
90
  def clear_session_cookie
91
- cookies.delete fridge_cookie_name, domain: :all
91
+ cookies.delete fridge_cookie_name, domain: auth_domain
92
92
  nil
93
93
  end
94
94
 
@@ -121,8 +121,14 @@ module Fridge
121
121
 
122
122
  def fridge_cookie_options
123
123
  secure = !Rails.env.development?
124
- options = { domain: :all, secure: secure, httponly: true }
124
+ options = { domain: auth_domain, secure: secure, httponly: true }
125
125
  options.merge(Fridge.configuration.cookie_options)
126
126
  end
127
+
128
+ def auth_domain
129
+ Aptible::Auth.configuration.root_url.sub(%r{^https?://}, '')
130
+ rescue StandardError
131
+ 'auth.aptible.com'
132
+ end
127
133
  end
128
134
  end
@@ -1,3 +1,3 @@
1
1
  module Fridge
2
- VERSION = '0.4.2'.freeze
2
+ VERSION = '0.4.3'.freeze
3
3
  end
@@ -104,7 +104,8 @@ describe Fridge::RailsHelpers do
104
104
  it 'should delete all cookies on error' do
105
105
  cookies[:fridge_session] = 'foobar'
106
106
  controller.session_token
107
- expect(cookies.deleted?(:fridge_session, domain: :all)).to be true
107
+ expect(cookies.deleted?(:fridge_session, domain: 'auth.aptible.com'))
108
+ .to be true
108
109
  end
109
110
 
110
111
  it 'should return nil on error' do
@@ -211,7 +212,7 @@ describe Fridge::RailsHelpers do
211
212
  it 'are configurable' do
212
213
  Fridge.configuration.cookie_options = { foobar: true }
213
214
  options = controller.fridge_cookie_options
214
- expect(options[:domain]).to eq :all
215
+ expect(options[:domain]).to eq 'auth.aptible.com'
215
216
  expect(options[:foobar]).to eq true
216
217
  end
217
218
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-30 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config