authie 4.0.0.rc5 → 4.0.0.rc6

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: 1d9373c828cdac9b7663eb05db6954ff069f5e6d8164d64c8dcf5fd165ca0d09
4
- data.tar.gz: c4b98e9bb20edce2539761806affda87fd4d56082b7c9e956842424cac8a6e27
3
+ metadata.gz: 3f0ed5ff2724edcadbe4c3da00f495f61c49fb8527a9a3ea990d6cbb0d1b3481
4
+ data.tar.gz: f3c621bd0cd8561123e39b508647d1bc5b356038928682d1b541635d9913c9cd
5
5
  SHA512:
6
- metadata.gz: b90a45ff82b29992deec7c2e7c09604a3a569bdfbe099ba2f7be26989c9bd91417b7446d7ea2d8ad0f85f55d42d9ed9356a203dc239e88f568ccf64cb4faa363
7
- data.tar.gz: 9c66674049a1a8c36389faa84764b296f7879d59b5cdd3c6bc7b06946874ffec6fec23cd1194a0b68367391237814938a1de19db0ef7958af005d7a9ce2d66ef
6
+ metadata.gz: f326f7e0aee77baccff01544c98730902fd77c722c803b49257bad520eb6f5340ab00bf585050b6a5d447409f86954147ec9e701d9af404948cb8f7977008c78
7
+ data.tar.gz: 55da617f47e858b869fb4e3f1afb14a45dd3ff2a661656db89906bdf66fd2c2a785ac70163de3e60e342f3e91601fcb058ff7a77663f840502268e77a224d7d5
@@ -9,10 +9,13 @@ module Authie
9
9
  # The controller delegate implements methods that can be used by a controller. These are then
10
10
  # extended into controllers as needed (see ControllerExtension).
11
11
  class ControllerDelegate
12
+ attr_accessor :touch_auth_session_enabled
13
+
12
14
  # @param controller [ActionController::Base]
13
15
  # @return [Authie::ControllerDelegate]
14
16
  def initialize(controller)
15
17
  @controller = controller
18
+ @touch_auth_session_enabled = true
16
19
  end
17
20
 
18
21
  # Sets a browser ID. This must be performed on any page request where AUthie will be used.
@@ -52,7 +55,7 @@ module Authie
52
55
  def touch_auth_session
53
56
  yield if block_given?
54
57
  ensure
55
- auth_session.touch if logged_in?
58
+ auth_session.touch if @touch_auth_session_enabled && logged_in?
56
59
  end
57
60
 
58
61
  # Return the user for the currently logged in user or nil if no user is logged in
@@ -26,5 +26,9 @@ module Authie
26
26
  def auth_session_delegate
27
27
  @auth_session_delegate ||= Authie::ControllerDelegate.new(self)
28
28
  end
29
+
30
+ def skip_touch_auth_session!
31
+ auth_session_delegate.touch_auth_session_enabled = false
32
+ end
29
33
  end
30
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authie
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.rc5
4
+ version: 4.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke