diff --git a/lib/delegates.rb b/lib/delegates.rb index 0406f21..6e1439e 100644 --- a/lib/delegates.rb +++ b/lib/delegates.rb @@ -104,7 +104,7 @@ def authorize(_options = {}) # Our important cookie names @iv = 'initialization_vector' - @auth = 'sinai_authenticated_3day' + @auth = 'sinai_authenticated_1year' # If we have just the raw cookies header, parse it into cookies parse_cookies if @cookies&.key?('Cookie') diff --git a/spec/custom_delegate_spec.rb b/spec/custom_delegate_spec.rb index 45ece0f..1badf33 100644 --- a/spec/custom_delegate_spec.rb +++ b/spec/custom_delegate_spec.rb @@ -88,7 +88,7 @@ 'request_uri' => 'http://example.org/iiif/asdfasdf/full/pct:70/0/default.jpg', 'full_size' => { 'width' => '1024', 'height' => '1024' }, 'cookies' => { - 'sinai_authenticated_3day' => auth_cookie_value + 'sinai_authenticated_1year' => auth_cookie_value } } expect(delegate.authorize).to eq(false) @@ -101,7 +101,7 @@ 'full_size' => { 'width' => '1024', 'height' => '1024' }, 'cookies' => { 'initialization_vector' => iv_cookie_value, - 'sinai_authenticated_3day' => auth_cookie_value + 'sinai_authenticated_1year' => auth_cookie_value } } expect(delegate.authorize).to be(true) @@ -114,7 +114,7 @@ 'full_size' => { 'width' => '1024', 'height' => '1024' }, 'cookies' => { - 'Cookie' => 'initialization_vector=' + iv_cookie_value + '; ' + 'sinai_authenticated_3day=' + auth_cookie_value + 'Cookie' => 'initialization_vector=' + iv_cookie_value + '; ' + 'sinai_authenticated_1year=' + auth_cookie_value } } expect(delegate.authorize).to be(true) @@ -127,7 +127,7 @@ 'full_size' => { 'width' => '1024', 'height' => '1024' }, 'cookies' => { 'initialization_vector' => iv_cookie_value, - 'sinai_authenticated_3day' => auth_cookie_value + 'sinai_authenticated_1year' => auth_cookie_value } } expect(delegate.source).to be('S3Source')