Sha256: 71029918ac53ad64a9f5edd7d12475d98b9ae5a20509c1cf1afcedb4e831b9d9

Contents?: true

Size: 814 Bytes

Versions: 5

Compression:

Stored size: 814 Bytes

Contents

module DeviseCasAuthenticatable
  module SingleSignOut

    class StoreSessionId
      def initialize(app)
        @app = app
      end

      def call(env)
        store_session_id_for_cas_ticket(env)
        @app.call(env)
      end

      private

      def store_session_id_for_cas_ticket(env)
        request = Rack::Request.new(env)
        session = request.session

        if session['cas_last_valid_ticket_store']
          sid = env['rack.session.options'][:id]
          Rails.logger.info "Storing sid #{sid} for ticket #{session['cas_last_valid_ticket']}"
          ::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.store_session_id_for_index(session['cas_last_valid_ticket'], sid)
          session['cas_last_valid_ticket_store'] = false
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
devise_cas_authenticatable-1.3.2 lib/devise_cas_authenticatable/single_sign_out/rack.rb
devise_cas_authenticatable-1.3.1 lib/devise_cas_authenticatable/single_sign_out/rack.rb
devise_cas_authenticatable-1.3.0 lib/devise_cas_authenticatable/single_sign_out/rack.rb
devise_cas_authenticatable-1.2.1 lib/devise_cas_authenticatable/single_sign_out/rack.rb
devise_cas_authenticatable-1.2.0 lib/devise_cas_authenticatable/single_sign_out/rack.rb