Sha256: 22b15296fd30f19f9e518046471c8aeea94f3fcf37adf86ff3512908219f667b

Contents?: true

Size: 917 Bytes

Versions: 9

Compression:

Stored size: 917 Bytes

Contents

module DeviseCasAuthenticatable
  class SessionStoreIdentifier

    def current_session_store
      app = Rails.application.app
      begin
        app = (app.instance_variable_get(:@backend) || app.instance_variable_get(:@app) || app.instance_variable_get(:@target))
      end until app.nil? or app.class == session_store_class
      app
    end

    def session_store_class
      @session_store_class ||=
        begin
          # Rails 3 & 4 session store
          if ::DeviseCasAuthenticatable::SingleSignOut.rails3_or_greater?
            Rails.configuration.session_store
            ::Rails.application.config.session_store
          else
            # => Rails 2
            ActionController::Base.session_store
          end
        rescue NameError => e
          # for older versions of Rails (prior to 2.3)
          ActionController::Base.session_options[:database_manager]
        end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
devise_cas_authenticatable-1.10.4 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.10.3 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.10.2 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.10.1 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.10.0 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.9.2 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.9.1 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.9.0 lib/devise_cas_authenticatable/session_store_identifier.rb
devise_cas_authenticatable-1.8.0 lib/devise_cas_authenticatable/session_store_identifier.rb