Sha256: 8b763d461210a4d4365e34ab17c5a0d3661061b354b643cfc8baa85a71c93215

Contents?: true

Size: 537 Bytes

Versions: 31

Compression:

Stored size: 537 Bytes

Contents

module BookingSync::Engine::SessionHelpers
  extend ActiveSupport::Concern

  private

  # Automatically resets authorization when the session goes inactive.
  # This is only enabled when the engine is set to embedded mode.
  def sign_out_if_inactive
    return unless BookingSync::Engine.embedded

    last_visit = session[:_bookingsync_last_visit]
    session[:_bookingsync_last_visit] = Time.now.to_i

    if last_visit && (Time.now.to_i - last_visit > BookingSync::Engine.sign_out_after)
      clear_authorization!
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
bookingsync-engine-6.0.1 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-6.0.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-5.1.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-5.0.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-4.0.3 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-4.0.2 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-4.0.1 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-4.0.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-3.0.2 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-3.0.1 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-3.0.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-2.0.2 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-2.0.1 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-2.0.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-1.1.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-1.0.2 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-1.0.1 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-1.0.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-0.5.0 lib/bookingsync/engine/session_helpers.rb
bookingsync-engine-0.4.6 lib/bookingsync/engine/session_helpers.rb