Sha256: a35cb521adc6132d7c48417e7c02a5a886d886292bd4cd7f5ac593283c73a5da

Contents?: true

Size: 1008 Bytes

Versions: 8

Compression:

Stored size: 1008 Bytes

Contents

module Reactor
  module SessionHelper
    module AuthHelper
      def rsession_auth
        if RailsConnector::Configuration.mode == :editor && (jsessionid = cookies["JSESSIONID"]).present?
          # Why the gsub? It's a dirty hack! Reason: JSESSIONIDs are unescaped
          # when read through Rails and hence all + are converted into spaces.
          # CM Kernel though stores escaped IDs.
          # From the possible generated characters only the + seems to be
          # problematic.
          # CGI.escape would be the solution, but it's deprecated
          # URI.escape does too much
          jsessionid.tr!(" ", "+")

          Rails.logger.info "Trying to log in at #{Reactor::Configuration.xml_access[:host]}:#{Reactor::Configuration.xml_access[:port]} with JSESSIONID=#{jsessionid}."
          rsession.login(jsessionid)
          Rails.logger.info %(Logged in as "#{rsession.user_name}".) if rsession.user?
        else
          rsession.destroy
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
infopark_reactor-1.29.1 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.29.0 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.28.0 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.27.0.rc10 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.27.0.rc9 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.27.0.rc8 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.27.0.rc7 lib/reactor/session_helper/auth_helper.rb
infopark_reactor-1.27.0.rc4 lib/reactor/session_helper/auth_helper.rb